#include<iostream.h>
#include<conio.h>
class a
{
public:
                int t;
};
class b
{
public:
                int u;
};
class c
{
public:
                int v;
};
class d
{
public:
                int w;
};
class e:public a,public b
{
public:
                int x;
};
class f:public c,public d
{
public:
                int y;
};
class g:public e,f
{
protected:
                int z;
public:
                void get()
                                {
                                t=10;
                                u=20;
                                v=30;
                                w=40;
                                x=50;
                                y=60;
                                z=70;
                                }
                void display()
                                {
                                cout<<"T = "<<t<<endl;
                                cout<<"U = "<<u<<endl;
                                cout<<"V = "<<v<<endl;
                                cout<<"W = "<<w<<endl;
                                cout<<"X = "<<x<<endl;
                                cout<<"Y = "<<y<<endl;
                                cout<<"Z = "<<z<<endl;
                                }
};
void main()
{
                clrscr();
                g obj;
                obj.get();
                obj.display();
                getch();
}

194.PNG

Advertisements