My Profile
Active Members
TodayLast 7 Days
more...
Awards & Gifts
Online Exams
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian
cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
Advertisements
|
C++ Program no. probability-5
Posted Date: 23 Mar 2008 Resource Type: Articles/Knowledge Sharing Category: Computer & Technology
|
Posted By: ashish singh Member Level: Diamond Rating: Points: 3
|
|
|
|
//Program no. 5 (probability)
#include #include #include #include void main() { textcolor(GREEN); clrscr(); int a,b,p1,b1,p2,b2; double s1,s2; cout<<"enter the num. of share of A in the lottery : "; cin>>a; cout<<"enter the num. of prizes and blanks :"; cin>>p1>>b1; cout<<"enter the num. of share of B in the lottery : "; cin>>b; cout<<"enter the num. of prizes and blanks :"; cin>>p2>>b2; s1=((nCr(p1,a))+((nCr(p1,1))*(nCr(b1,1))))/nCr((p1+b1),a); cout<<"\n\n\athe probability of success of A is : "<s2=(nCr(p2,3)+nCr(p2,2)*nCr(b2,1)+nCr(p2,1)*nCr(b2,2))/nCr((p2+b2),b); cout<<"\n\n\athe probability of success of B is : "<cout<<"\n\n\athe ratio of success of A:B 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 the num. of share of A in the lottery : 2 enter the num. of prizes and blanks :3 5 enter the num. of share of B in the lottery : 3 enter the num. of prizes and blanks :4 6
the probability of success of A is : 0.642857
the probability of success of B is : 0.833333
the ratio of success of A:B is 0.771429
|
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|
|
|