program faktorial

program faktorial;
uses wincrt;

var
i,j,n,a:integer;

begin
writeln('nama : Afit Miranto');
writeln('NPM : G1D009001');
writeln('PRODI : Teknik Elektro');
write('masukkan nilai n: ');
readln(n);
writeln('nilai faktorialnya adalah ');
for i:=1 to n do

begin
for j:=1 to i do
begin
a:=1;
for j:=1 to i do
a:=a*j;
end;
write(a, ' ');
end;
readln;
donewincrt
end.

Categories:

0 comments:

Post a Comment