Friday, January 23, 2009

Factorial Case

We often finish the factorial case with formula like this:

general formula =
n!=n*(n-1)*((n-1)-1).....*1

for the example:
5! =5*4*3*2*1
3! =3*2*1

We can finish the factorial case with statement like this :

begin
read(N);
fak:=1
for I:=1 to N do
fak:=fak*I;
end

if you are running this statement so

for completely source code you can download here.

Download

1 comment:

setiady said...

makasih baget y mas..