Greatest Common Factor Calculator in JavaScript – Programming Code Examples
JavaScript

Greatest Common Factor Calculator in JavaScript2 min read

Greatest common factor (GCF) calculator. Is also known as greateset common divisor (GCD).

GCF calculator

GCF example

Find GCF for numbers 8 and 12:




The divisors of 8 are:

8 = 2×2×2

The divisors of 12 are:

12 = 2×2×3

So the common divisors of 8 and 12 are:

gcf = 2×2 = 4

So 8/12 fraction, can be reduced to 2/3:

8 / 12 = (8/4) / (12/4) = 2 / 3

 

gcf.html

 

Leave a Comment