Programming Examples
Python program to find GCD of 2 number
Write a Python program to input two number and find the G.C.D
Solution
n1=int(input("Enter Number 1 : "))
n2=int(input("Enter Number 2 : "))
while(n2):
n1, n2 = n2, n1 % n2
print("G.C.D. : ",n1)
Output
Enter Number 1 : 21
Enter Number 2 : 14
H.C.F. : 7