73. Python Program to find GCD of given n numbers.
How does this program work?
- This program is used to find GCD or HCF of given n numbers using Python.
- GCD or HCF (Highest Common Factor) of numbers is the largest number that divides by them.
Here is the code
a=int(input("Enter first number: "))
b=int(input("Enter second number: "))
s = 0
gcd = 0
if(a>b):
s = b
else:
s = a
for i in range(1,s+1):
if(a % i == 0) and (b % i == 0):
gcd = i
print("GCD of ",a," and ",b , " is : ",gcd)