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.
|
C++ Program for probability- 4
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. 4 (probability)
#include #include #include void main() { textcolor(GREEN); clrscr(); float a1,a2,b1,b2,c1,c2,p1,p2; cout<<"enter the success ratio of A in the form (x,y) : "; cin>>a1>>a2; cout<<"enter the success ratio of B in the form (x,y) : "; cin>>b1>>b2; cout<<"enter the success ratio of C in the form (x,y) : "; cin>>c1>>c2; cout<<"\n\awhen any two hit the shot "; p1=((a1/a2)*(b1/b2)*((c2-c1)/(c2)))+(((a2-a1)/a2)*(b1/b2)*(c1/(c2)))+((a1/a2)*((b2-b1)/b2)*(c1/c2)); cout<<"\n\nthe probability in this case is "<cout<<"\nwhen all three review the book "; p2=((a1/a2)*(b1/b2)*(c1/c2)); cout<<"\n\nthe probability in this case is "<cout<<"\nthe required probability 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 success ratio of A in the form (x,y) : 4 5 enter the success ratio of B in the form (x,y) : 3 4 enter the success ratio of C in the form (x,y) : 2 3
when any two hit the shot the probability in this case is 0.433333
when all three review the book the probability in this case is 0.4
the required probability is 0.833333
|
Responses
|
No responses found. Be the first to respond and make money from revenue sharing program.
|
|
Watch TV Channels
|