Matuiss2

Solved-finding the LCM

Sep 14th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. num1 = int(input("Type an exact number:"))
  2. num2 = int(input("Type another exact number:"))
  3.  
  4. max = max(num1, num2)
  5. min = min(num1, num2)
  6. bigger = max
  7.  
  8. while bigger % min != 0:
  9. bigger += max
  10.  
  11. print("The LCM is", bigger)
Advertisement
Add Comment
Please, Sign In to add comment