Advertisement
ayshan

Lcm and Gcd

Apr 8th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. a=int(input())
  2. b=int(input())
  3. c=0
  4. if a>b:
  5. c=a
  6. else:
  7. c=b
  8. while(True):
  9. if c%a==0 and c%b==0:
  10. lcm=c
  11. break
  12. c+=1
  13. print("lcm",lcm)
  14. print("gcd",a*b/lcm)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement