Euclid's
Algorithm can be difficult to understand if you don't have an
example. So I've prepared one. I hope it helps.
Problem: Find the
greatest common divisor of the numbers 636 and 483.
Solution: In essence, this means "find the greatest number that fits evenly into both 636 and 483". You take the following steps:
636 = 483 * 1 + 153 /* 153 is the remainder from 636 ÷ 483. */
483 = 153 * 3 + 24
153 = 24 * 6 + 9
24 = 9 * 2 + 6
9 = 6 * 1 + 3
6 = 3 * 2 + 0 /* Stop when remainder = 0 */
So 3 is the GCD of 636 and 483.
Any questions, suggestions or errors, please msg me.