function lcm(a,b: integer): integer;
(* Compute lcm of a, b
*)
var
temp, prod: integer;
begin
prod := a * b;
if (a=0) or (b=0) then
lcm := 0
else
begin
repeat
temp := a mod b;
a := b;
b := temp
until b = 0;
lcm := prod div a;
end
end;
// Compute lcm of a,b
int temp, prod;
prod = a* b;
(a == 0 || b == 0)
return 0;
temp = a % b;
(b != 0)
return prod / a;