Tulis aja dulu, siapa tahu orang lain butuh :-)

PROGRAM FAKTORIAL


Program Faktorial;


Uses Wincrt;


Var
i,n,x : integer;


Begin
writeln('Program Faktorial');
writeln('=================');
writeln;
write('Masukkan Nilai Faktorial: ');readln(n);
writeln;


if (n<=0) then
writeln('Hasil Faktorial: ',1)
else
<!--more-->
Begin
  x:=1;
For i := 1 to n do
  x:=x*i;
  writeln('Hasil Faktorial: ',x);
End;
End.
Share:

0 komentar:

Post a Comment

ARCHIEV

VISITORS

free counters

FRIENDS

Blog Archive