gcd.in 147 B

123456789101112
  1. /* Compute the gcd of 1071, 1029: 21 */
  2. a = 1071;
  3. b = 1029;
  4. while (b != 0) {
  5. new_a = b;
  6. b = a % b;
  7. a = new_a;
  8. }
  9. print(a);