## Computer Science: An Overview: Global Edition (12th Edition)

The Euclidean algorithm finds the greatest common divisor of two positive integers X and Y by the following process: $X ←$ the larger input; $Y ←$the smaller input; while (Y not zero) do (Remainder ← remainder after dividing X by Y; $X ← Y$; $Y ← Remainder$); $GCD ← X$