Python/maths/find_lcm.py
Vysor df04d94543 Some directories had a capital in their name [fixed]. Added a recursive factorial algorithm. (#763)
* Renaming directories
* Adding a recursive factorial algorithm
2019-04-22 22:53:56 +08:00

19 lines
330 B
Python

def find_lcm(num_1, num_2):
max = num_1 if num_1 > num_2 else num_2
lcm = max
while (True):
if ((lcm % num_1 == 0) and (lcm % num_2 == 0)):
break
lcm += max
return lcm
def main():
num_1 = 12
num_2 = 76
print(find_lcm(num_1, num_2))
if __name__ == '__main__':
main()