An algorithm isn't necessary in this case. The factors of 4 are 1, 2 and 4 and the factors of 6 are 1, 2, 3 and 6. Just by looking at them we can tell that the common factors are 1 and 2 and that the greatest of these is 2.
GCD(4, 5) = 1.
GCD: 4
The Greatest Common Divisor (GCD) for 4 20 is 4
Greatest Common Divisor (GCD) for 12 8 is 4.
since 14 = 14 x 1 and 56 = 14 x 4 the answer is 14, since it divides evenly into both and clearly nothing larger will.There is a clever algorithm that can help you work this out in the general case:GCD(14, 56) = GCD(14, 56 - 14) = GCD(14, 42)This step (subtract the smaller from the larger) relies on the fact that any number that divides both 14 and 56 also divides 56 - 14.Repeat this:GCD(14, 42) = GCD(14, 42 - 14) = GCD(14, 28)GCD(14, 28) = GCD(14, 28 - 14) = GCD(14, 14)which is clearly 14.This is called Euclid's Algorithm.
GCD(12, 40) = 4
4
two
The Greatest Common Divisor (GCD) for 36 20 is 4.
Greatest Common Divisor (GCD) for 200 164 is 4.
Greatest Common Divisor (GCD) for 8 28 is 4.
The Greatest Common Divisor (GCD) for 36 100 is 4