Concept Flow - GCD and LCM Euclidean Algorithm
Start with two numbers a, b
Check if b == 0?
Yes→GCD is a
No
Calculate a % b
Set a = b, b = a % b
Repeat until b == 0
Calculate LCM = (original_a * original_b) / GCD
Start with two numbers, repeatedly replace a with b and b with a mod b until b is zero. The last non-zero a is the GCD. Then calculate LCM using the formula.
