Back

Write a code to get 2 integers as input and find the HCF of the 2 integer without using recursion or Euclidean algorithm.

Created 3 years ago
283 Views
2 Comments
ManojMHolagi
@ManojMHolagi
ManojMHolagi
@ManojMHolagiProfile is locked. Login
x, y = [int(x) for x in input().split()]
if x<y:
    smaller = x
else:
    smaller = y
for i in range(1,smaller+1):
    if(x%i == 0 ) and (y%i == 0):
        hcf = i
print(hcf)        

I am getting this error, can anyone assist me?

I want to know reason for error I am getting

Comments (2)
Please login to comment.