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

193.PNG

Advertisements