74. Python Program to find LCM of given n numbers.
How does this program work?
- This program is used to find LCM of given n numbers using Python.
- LCM (Least Common Multiple) of given numbers is the smallest number which can be divided by given numbers.
Here is the code
x = int(input("Enter first number: "))
y = int(input("Enter second number: "))
if x > y:
greater = x
else:
greater = y
while(True):
if((greater % x == 0) and (greater % y == 0)):
lcm = greater
break
greater += 1
print("LCM of ",x," and ",y," is : ",lcm)