begin writeln('Enter two numbers:'); readln(num1, num2);
if (num1 > num2) then LCM := num1 else LCM := num2;
while true do begin if (LCM mod num1 = 0) and (LCM mod num2 = 0) then begin writeln('The Least Common Multiple of ', num1, ' and ', num2, ' is: ', LCM); break; end; LCM := LCM + 1; end; end.
program FindLCM;
var
num1, num2, LCM, i: Integer;
begin
writeln('Enter two numbers:');
readln(num1, num2);
if (num1 > num2) then
LCM := num1
else
LCM := num2;
while true do
begin
if (LCM mod num1 = 0) and (LCM mod num2 = 0) then
begin
writeln('The Least Common Multiple of ', num1, ' and ', num2, ' is: ', LCM);
break;
end;
LCM := LCM + 1;
end;
end.