Skip to content

Commit 7504527

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#335 from Code-hunter-star/master
created LCM finder program
2 parents a9e0d0e + 1792bf2 commit 7504527

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

LCM finder

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
#https://www.facebook.com/mayankgbrc/posts/2726954114288546
3+
#subscribed by code house
4+
5+
# Python Program to find the L.C.M. of two input number
6+
7+
def compute_lcm(x, y):
8+
9+
# choose the greater number
10+
if x > y:
11+
greater = x
12+
else:
13+
greater = y
14+
15+
while(True):
16+
if((greater % x == 0) and (greater % y == 0)):
17+
lcm = greater
18+
break
19+
greater += 1
20+
21+
return lcm
22+
23+
num1 = 54
24+
num2 = 24
25+
26+
print("The L.C.M. is", compute_lcm(num1, num2))

0 commit comments

Comments
 (0)