wfunction
lcm(a,b: integer): integer;
w(* Compute
lcm of a, b *)
wvar temp, prod: integer;
wbegin prod := a * b;
w if (a=0) or (b=0) then
w lcm := 0
w else begin
w repeat
w temp := a mod b;
w a := b;
w b := temp
w until b = 0;
w lcm := prod div a;
w end
wend;