Thursday, 5 December 2013

Program Faktorial Menggunakan Turbo Pascal

program faktorial;
uses wincrt;
var i,n,x:integer;
begin
write ('Masukan Nilai Faktorial : ');readln(n);
writeln;
if (n<=0) then
writeln('Hasil Faktorial : ',1)
else
  begin
  x:=1;
  for i:=1 to n do
      x:=x*i;
  writeln ('Hasil Faktorial : ',x);
  end;
end.

 

Tampilan Program :

image

Semoga Bermanfaat Smile

1 comments: