Tanya Komputer

Categories

factorial function

can you give me the example of factorial function in delphi?

here the examples of the factorial function
function Faktorial(n: Integer): LongInt;
var c: Integer;
begin
Result:=1;
if n=0 then Exit;
for c:=1 to n do
Result:=Result*c;
end;

By Banyan | Via website
 
Copyright © agusbudi 2009, All Rights Reserved