There are several ways to compute GCD as given on Wikipedia page, but we will use Euclid's algorithm, which is well suited for programming. Note- Take care that the arguments are positive integers only. You can call GCD(abs(a), abs(b)) to ensure the negative integers are converted to...
Euclid Writes an Algorithm: A FairytaleLeslie Lamport