HCF and LCM using Python

 


a=36

b=56

d_a=a 

d_b=b 

r=a%b 

while r !=0:

    a,b=b,r 

    r=a%b 

hcf=b 

lcm=(d_a*d_b)/hcf

print("hcf:",hcf," ","lcm:",lcm)

Comments

Popular posts from this blog

Trouble with the Number System

Residue Arithmetic

Perfect Peak of Array