HCF-
- stands for Highest common factor
Example -
HCF of 8 and 12 is 4
HCF of 13,17,11 and 31 is 1
HCF of 100,200 and 300 is 100
HCF of 8,12,20,42 and 54 is 2
program -
def check(l,n):
for i in l:
if i%n!=0:
return 0
return 1
print("Enter numbers to find the HCF")
l=list(map(int,input().split()))
m=min(l)
while(1):
if check(l,m):
print("HCF is - "+str(m))
break
m=m-1
Enter numbers to find the HCF
13 17 11 31
HCF is - 1
Enter numbers to find the HCF
8 12 20 42
HCF is - 2