Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Latihan10;
- {$mode objfpc}{$H+}
- uses
- {$IFDEF UNIX}{$IFDEF UseCThreads}
- cthreads,
- {$ENDIF}{$ENDIF}
- Classes
- { you can add units after this };
- var
- Fac, Num, i: Integer;
- begin
- write('Mohon memasukan nomer: ');
- readln(Num);
- Fac:=1;
- for i:= Num downto 1 do
- Fac:= Fac * i;
- writeln('Factorial dari ', Num, ' adalah ', Fac);
- writeln('Tekan tombol ENTER untuk menutup');
- readln;
- end.
Add Comment
Please, Sign In to add comment