Python Program to Find LCM of Two Numbers
The LCM of two numbers is the smallest positive integer that is perfectly divisible by the two given numbers.
# Python Program to find the L.C.M. of two input number
a=int(input("Enter first number: "))
b=int(input("Enter seconf number: "))
def lcm(x, y):
if x > y:
greater = x
greater = y
if((greater % x == 0) and (greater % y == 0)):
lcm = greater
greater += 1
print("The L.C.M. is", lcm(a, b))
Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more.
Sign Up for our weekly newsletter to get update about new content.