program faktorial; {program menghitung nilai faktorial dari inputan N}
uses wincrt;
var
i,N,jumlah :integer;
begin
writeln(' ================================================= ');
writeln('');
writeln(' PROGRAM MENGHITUNG FAKTORIAL ');
writeln(' Dibuat oleh ricky coebra ');
writeln(' @copyright 2013 ');
writeln('');
writeln(' ================================================= ');
jumlah:=1;
write('inputkan suatu nilai : '); readln(N);
write('faktorial dari ',N,' adalah : ');
write('1');
for i:=2 to N do
begin
write(' x ',i);
jumlah:=jumlah*i;
end;
write(' = ',jumlah);
end.
No comments:
Post a Comment