program faktorial;
uses crt;
var nilai,i,a:integer;
begin
clrscr;
a:=1;
writeln('INPUT');
write('faktorial berapa? ');readln(nilai);
write(nilai,'!= ');
for i:=nilai downto 1 do
begin
a:=i*a;
if i>1 then
begin
write(i,'*');
end
else
begin
write(i,'=');
end;
end;
write(a);
readln;
end.
Tidak ada komentar:
Posting Komentar