Python Program to Find LCM of Two Numbers using Recursion

Python Program to Find LCM of Two Numbers using Recursion

Write Python Program to Find LCM of Two Numbers using Recursion

# Write Python Program to Find LCM of Two Numbers using Recursion

def gcd(n, m):
    if m == 0:
        return n
    else:
        return gcd(m, n % m)

n = 72
m = 32
lcm = (n * m) // gcd(n, m) 
print(f'LCM of {n} and {m} = {lcm}') 

Output:

LCM of 72 and 32 = 288