مش راضي يعمل run ممكن تشوفه
#include <iostream>
using namespace std;
int main()
{
cout<<"enter 1 for prob";
cout<<"enter 2 for mean";
cout<<"enter 3 for variance";
cout<<"enter 4 for sd";
int selection;
cin>>selection;
if(selection==1)
{int x;
float p,q;
cout<<"enter x,p,q";
cin>>x,p,q;
double prob=(pow(q.0,x-1.0)*p,
cout<<"q^(x-1) is"<<prob;
}
else if(selection==2)
{
float p;
cout<<"please enter p";
cin>>p;
int mean=1/p;
cout<<"mean is"<<mean;
}
else if(selection==3)
{
float q,p;
cout<<"please enter q,p";
cin>>q,p;
int variance=q/(p*p);
cout<<"variance is"<<variance;
}
else if(selection==4)
{
float q,p;
cout<<"please enter q,p";
cin>>q,p;
double sd=pow(q.0,2.0)/p;
cout<<"q^2"<<sd;
}
else
{
cout<<"incorrect selection";
}
return 0;
}
|