Skip to content

Commit 61cea00

Browse files
authored
Merge pull request swaaz#263 from sharansk792000/master
update
2 parents 5126014 + 00bb251 commit 61cea00

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

File renamed without changes.

Python/Program 32/Program32.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# defining a function to calculate LCM
2+
def calculate_lcm(x, y):
3+
# selecting the greater number
4+
if x > y:
5+
greater = x
6+
else:
7+
greater = y
8+
while(True):
9+
if((greater % x == 0) and (greater % y == 0)):
10+
lcm = greater
11+
break
12+
greater += 1
13+
return lcm
14+
15+
# taking input from users
16+
num1 = int(input("Enter first number: "))
17+
num2 = int(input("Enter second number: "))
18+
# printing the result for the users
19+
print("The L.C.M. of", num1,"and", num2,"is", calculate_lcm(num1, num2))

Python/Program 32/Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Program to Calculate LCM of two number

0 commit comments

Comments
 (0)