Computer Science, asked by kundunilay89, 3 months ago

Write a program to input two integers and find their Least Common Multiple(L.C.M).
For Example,
INPUT: Enter 2 integers:
12
8
OUTPUT: L.C.M. = 24

Answers

Answered by jai696
2

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def gcd(a,b):

if a == 0:

return b

return gcd(b % a, a)

lcm = lambda a, b: (a / gcd(a, b)) * b

a, b = list(map(int, input("enter a, b: ").split()))

print("LCM:", lcm(a, b))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions