Tuesday, October 12, 2010

HCF

a=420
b=360
c= int ((a+b)/2)
loop:
if a/c = int (a/c) and b/c = int (b/c) then
print "The highest common factor to a and b is "+ c
end
end if
c=c-1
goto loop

No comments:

Post a Comment