Problem

Return GCD of a and b using Euclid's algorithm (while loop).

Examples

  • gcdWhile(12, 8) -> 4
  • gcdWhile(7, 13) -> 1
Compile and test (Ctrl+Enter)