RosettaCodeData/Task/Least-common-multiple/Pascal/least-common-multiple.pascal
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

12 lines
237 B
Text

Program LeastCommonMultiple(output);
function lcm(a, b: longint): longint;
begin
lcm := a;
while (lcm mod b) <> 0 do
inc(lcm, a);
end;
begin
writeln('The least common multiple of 12 and 18 is: ', lcm(12, 18));
end.