Pascal classical algorithm - finding the least common multiple of two numbers

From , 5 Years ago, written in Delphi (Object Pascal), viewed 123 times.
URL https://pastebin.vip/view/d064bf1a
  1. function lcm(a, b: Integer): Integer;
  2. begin
  3.   if a < b then
  4.     Swap(a, b);
  5.   lcm := a;
  6.   while lcm mod b > 0 do
  7.     Inc(lcm, a);
  8. end;

Reply to "Pascal classical algorithm - finding the least common multiple of two numbers"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website