0
hcf
programme to find hcf of any two numbers from the user
1 Antwort
+ 1
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
hcf = 1
if num1 > num2:
smaller = num2
else:
smaller = num1
for i in range(2,smaller + 1):
if((num1 % i == 0) and (num2 % i == 0)):
hcf = i
print(hcf)