#include"iostream.h"
class alpha
{
int x;
public:
alpha(int i)
{
x=i;
cout<<"alpha initialized \n";
}
void show_x(void)
{
cout<<"x="<
};
class beta
{
float y;
public:
beta(float j)
{
y=j;
cout<<"beta initialized \n";
}
void show_y(void)
{
cout<<"y="<
};
class gamma:public beta,public alpha
{
int m,n;
public:
gamma(int a, float b, int c, int d):
alpha(a),beta(b)
{
m=c;
n=d;
cout<<"gamma initialized \n";
}
void show_mn(void)
{
cout<<"m="<
};
int main()
{
gamma g(5,10.75,20,30);
cout<<"\n";
g.show_x();
g.show_y();
g.show_mn();
return 0;
}
No comments:
Post a Comment