Greatest common divisor Delphi Function


function GCD(a,b : integer):integer;
begin
  if (b mod a) = 0 then Result := a
  else Result := GCD(b, a mod b) ;
end;

No comments:

Post a Comment