Algorithm 1 Euclid’s Algorithm
1: procedure Euclid(a, b) ▷ Find the greatest common divisor of a and b
2: r ← a mod b
3: while r ̸= 0 do ▷ We have the answer if r is 0
4: a←b
5: b←r
6: r ← a mod b
7: end while
8: return b ▷ The gcd is b
9: end procedure