diff --git a/hcf and lcm b/hcf and lcm new file mode 100644 index 0000000..58f995e --- /dev/null +++ b/hcf and lcm @@ -0,0 +1,14 @@ +a = int(input("Enter the first number: ")) +b = int(input("Enter the second number: ")) + +HCF = 1 + +for i in range(2,a+1): + if(a%i==0 and b%i==0): + HCF = i + +print("First Number is: ",a) +print("Second Number is: ",b) + +LCM = int((a*b)/(HCF)) +print("LCM of the two numbers is: ",LCM) \ No newline at end of file