Selasa, 06 Januari 2015


program Project15;
{$APPTYPE CONSOLE}
uses
  SysUtils;
procedure faktorial(var fak, hasil:integer);
    var
      a:integer;
    begin
      hasil:=1;
      for a := 2 to fak do
      hasil:=hasil*a;
    end;
    var
      z,b,c,d,nminr:integer;
      f1,f2,f3:integer;
      x:real;
begin
  writeln ('NIM  : 114224010');
  writeln ('NAMA : BENNY KURNIAWAN');
  writeln ('================================');
  writeln ('CONTOH PENULISAN RUMUS FAKTORIAL');
  writeln ('================================');
  writeln ('');
  write('Masukkan N = '); readln(b);
  write('Masukkan R = '); readln(c);
  faktorial(b,f1);
  nminr:=b-c;
  faktorial(nminr,f2);
  faktorial(c,f3);
  x:=f1/f2*f3;
  writeln('Hasil      = ', x:3:2);
  readln;
  { TODO -oUser -cConsole Main : Insert code here }
end.

0 komentar:

Posting Komentar

Categories

Total Tayang

Jam

Kalender Islam

Diberdayakan oleh Blogger.

Popular Posts

Pengikut