Get your own website
Python
C
Java
 
Python result:
C result:
Java result:
The Euclidean algorithm using division:

120 = 4 * 25 + 20
25 = 1 * 20 + 5
20 = 4 * 5 + 0
The GCD of 120 and 25 is: 5
The Euclidean algorithm using division:

120 = 4 * 25 + 20
25 = 1 * 20 + 5
20 = 4 * 5 + 0
The GCD of 120 and 25 is: 5
The Euclidean algorithm using division:

120 = 4 * 25 + 20
25 = 1 * 20 + 5
20 = 4 * 5 + 0
The GCD of 120 and 25 is: 5