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.
0 komentar:
Post a Comment