From 00bb2517eb845a3f7d8fb4ff802b99a55fa32658 Mon Sep 17 00:00:00 2001 From: sharan Date: Sun, 3 Oct 2021 01:39:44 +0530 Subject: [PATCH] update --- Python/Program 31/{README.m => README.md} | 0 Python/Program 32/Program32.py | 19 +++++++++++++++++++ Python/Program 32/Readme.md | 1 + 3 files changed, 20 insertions(+) rename Python/Program 31/{README.m => README.md} (100%) create mode 100644 Python/Program 32/Program32.py create mode 100644 Python/Program 32/Readme.md diff --git a/Python/Program 31/README.m b/Python/Program 31/README.md similarity index 100% rename from Python/Program 31/README.m rename to Python/Program 31/README.md diff --git a/Python/Program 32/Program32.py b/Python/Program 32/Program32.py new file mode 100644 index 00000000..1f1b096a --- /dev/null +++ b/Python/Program 32/Program32.py @@ -0,0 +1,19 @@ + # defining a function to calculate LCM +def calculate_lcm(x, y): + # selecting the greater number + if x > y: + greater = x + else: + greater = y + while(True): + if((greater % x == 0) and (greater % y == 0)): + lcm = greater + break + greater += 1 + return lcm + + # taking input from users +num1 = int(input("Enter first number: ")) +num2 = int(input("Enter second number: ")) + # printing the result for the users +print("The L.C.M. of", num1,"and", num2,"is", calculate_lcm(num1, num2)) \ No newline at end of file diff --git a/Python/Program 32/Readme.md b/Python/Program 32/Readme.md new file mode 100644 index 00000000..7254c7b6 --- /dev/null +++ b/Python/Program 32/Readme.md @@ -0,0 +1 @@ +Program to Calculate LCM of two number \ No newline at end of file