17 lines
286 B
Python
17 lines
286 B
Python
def gcd():
|
|
i1 = int(input("enter first number : "))
|
|
i2 = int(input("enter second number : "))
|
|
|
|
while True:
|
|
i1 // i2
|
|
r = i1 % i2
|
|
|
|
if r == 0:
|
|
print(f"GCD= {i2}")
|
|
break
|
|
|
|
else:
|
|
i1 = i2
|
|
i2 = r
|
|
|
|
gcd() |