PROGRAM PENGHITUNG FAKTORIAL

Program Faktorial_pascal;
uses wincrt;
function Faktorial(a:integer):longint;
begin
if (A=1)then
Faktorial:=1
else
Faktorial:=a*faktorial(a-1);
end;
var
x:integer;
begin
clrscr;
writeln('Program Penghitung Faktorial');
writeln;
write('Berapa Faktorial : ');readln(x);
writeln(x,' faktorial ','= ',faktorial(x));

end.

0 komentar:

Posting Komentar

 
ACBAR POE BLOG © 2011 | Designed by Syah Acbar, in Computer Engineering UNIPA with Modern Warfare 3, VPS Hosting and Compare Web Hosting
Back To Top