#include
#include
#include
void main()
{
textcolor(LIGHTBLUE);
clrscr();
int num;
float s,c,t,sa,ca,ta,sum=0,p;
cout<<"enter the number of scooter drivers = ";
cin>>s;
cout<<"the chances of scooter accident = ";
cin>>sa;
cout<<"enter the number of car drivers = ";
cin>>c;
cout<<"the chances of car accident = ";
cin>>ca;
cout<<"enter the number of truck drivers = ";
cin>>t;
cout<<"the chances of truck accident = ";
cin>>ta;
sum=s*sa+c*ca+t*ta;
p=s*sa/sum;
cout<<"\n\nthe probability that scooterist has met an accident = "<
delay(800);
textcolor(RED);
cout<<"\n\n\a";
cprintf("PROGRAM DESIGNED BY:ASHISH KUMAR");
cout<<"\n\n";
cprintf("/ roll 249/06 ");
getch();
}
output:
enter the number of scooter drivers = 2000
the chances of scooter accident = 0.01
enter the number of car drivers = 4000
the chances of car accident = 0.03
enter the number of truck drivers = 6000
the chances of truck accident = 0.15
the probability that scooterist has met an accident = 0.019231
No comments:
Post a Comment