// Euclid's GCD by repeated subtraction. int GCD(int a, int b) { while (a != b) { if (a > b) { a = a - b; }; if (b > a) { b = b - a; } }; return a; }