Last active
May 26, 2021 10:23
-
-
Save bharathmuddada/b2df8786fcf0d516da252776ee47c926 to your computer and use it in GitHub Desktop.
LCM in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = int(input("Enter your number \n")) | |
| b = int(input("Enter your number \n")) | |
| res = max(a, b) | |
| while res <= a * b: | |
| if res % a == 0 and res % b == 0: | |
| break | |
| res += 1 | |
| print(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment