Note.....

Dear readers I Have collected these Programs from various sources of internet...I don't know what the header file is Please mail me if any error found hi2rashid@yahoo.co.in

Sponsored....

Tuesday, April 13, 2010

C++ Program for probability- 2

//program no. 2 (probability)

#include
#include
#include
#include
void main()
{
int tc,ace,dc;
textcolor(BROWN);
clrscr();
cout<<"\aenter total no. of cards : ";
cin>>tc;
cout<<"\aenter the no. of aces : ";
cin>>ace;
cout<<"\aenter the no. of aces drawn : ";
cin>>dc;
float prob=nCr(ace,dc)/nCr(tc,dc);
cout<<"the probability of drawing "<<<" aces in a pack of "<<<"
is "<
delay(100);
textcolor(RED);
cout<<"\n\n\a";
cprintf("PROGRAM DESIGNED BY:ASHISH KUMAR");
cout<<"\n\n";
cprintf("/ roll 249/06 ");
getch();
}

output:
enter total no. of cards : 52
enter the no. of aces : 4
enter the no. of aces drawn : 2
the probability of drawing 2 aces in a pack of 52 is 0.004525

No comments:

Post a Comment