Welcome to my blog..!! Enjoy to read and get your knowledge. Hopefully, you can understand it

Kamis, 05 Januari 2012

PROGRAM BINOMIAL


program binomial;
uses wincrt;
var i,j,k,n,x: longint;
a,b,c,d,e,p:real;
begin
readln(n,x,p);
a:=1; b:=1; c:=1; d:=1; e:=1;
for i:=1 to n do
a:=a*i;
for j:=1 to x do
begin
b:=b*j;
c:=c*p;
end;
for k:=1 to (n-x) do
begin
d:=d*k;
e:=e*(1-p);
end;
writeln(a/(b*d)*c*e);
end.

0 komentar:

Posting Komentar

 

Reta Noorina Prastika 1311100090 Blak Magik is Designed by productive dreams for smashing magazine Bloggerized by Ipiet
Thanks to Blogger Templates Blog | Distributed by Deluxe Templates © 2008