#include<iostream>
#include<conio.h>
using namespace std;
class alpha
{
int i;
public:
alpha(int z)
{
i=z;
}
void show_1()
{
cout<<i<<endl;
}
};
class beta
{
int j;
public:
beta(int x)
{
j=x;
}
void show_2()
{
cout<<j<<endl;
}
};
class gamma : public beta , public alpha
{
int m,n;
public:
gamma(int a, int b, int c, int d):alpha(a), beta(b)
{
m=c;
n=d;
}
void show_3(void)
{
cout<<"value of m is"<<" "<<m<<endl;
cout<<"value of n is"<<" "<<n<<endl;
}
};
int main()
{
gamma g(5,10,75,20);
g.show_1();
g.show_2();
g.show_3();
getch();
return 0;
}
No comments:
Post a Comment