Program
KOMBINASI;
uses
wincrt;
var
f1,f2,f3:longint;
n,r,nr:integer;
c:
real;
Procedure
fact( n:integer; var f:longint);
var
i:integer;
begin
f:=1;
for
i:=1 to n do
f:=
f * i;
end;
Begin
gotoxy(33,3);
writeln('samsuri');
gotoxy(30,4);
writeln('rCn
= n!/(r!(n-r)!)');
gotoxy(20,5);
writeln('Nilai
r harus lebih kecil/sama dengan n');
gotoxy(20,6);
writeln;gotoxy(19,7);
writeln('-------------------------------------------');
write;gotoxy(28,8);
write('[1.Masukkan
nilai n :',' ');readln(n);
writeln;gotoxy(28,9);
write('[2.Masukkan
nilai r :',' ');readln(r);
fact(n,f1);
fact(r,f2);
nr:=(n-r);
fact(nr,f3);
c:=
f1/(f2*f3);
gotoxy(19,10);
writeln('--------------------------------------------');
gotoxy(30,11);
write('Hasilnya
:',' ',c:2:0);
readln;
end.