Pergunta de entrevista da empresa LTIMindtree

Write a program to calculate the Least Common Multiple (LCM) of two numbers.

Resposta da entrevista

Sigiloso

19 de set. de 2023

import math num1 = int(input("Enter first number: ")) num2 = int(input("Enter second number: ")) lcm = (num1 * num2) // math.gcd(num1, num2) print(f"The LCM of {num1} and {num2} is {lcm}")