#include<iostream.h>
class alpha
{
int x;
public:
alpha(int i)
{
x=i;
cout<<"\n alpha constructor";
}
void show_alpha(void)
{
cout<<"x="<<x<<"\n";
}
};
class beta
{
float p,q;
public:
beta( float a,float b):p(a),q(b+p)
{
cout<<"\n beta constructor";
}
void show_beta(void)
{
cout<<"p="<<p<<"\n";
cout<<"q="<<q<<"\n";
}
};
class gamma:public beta,public alpha
{
int u,v;
public:
gamma(int a,int b,float c):alpha(a*2),u(a)
{
beta(c,c);
v=b;
cout<<"\n gamma constucted";
}
void show_gamma(void)
{
cout<<" u ="<<u<<"\n";
cout<<"v = "<<v<<"\n";
}
};
int main()
{
gamma g(2,4,2.5);
cout<<"\n\n display members values"<<"\n\n";
g.show_alpha();
g.show_beta();
g.show_gamma();
return 0;
}
got strucked up with the error