#include<iostream.h>
#include<conio.h>
class base1
{
public:
                int b1;
};
class base2
{
public:
                int b2;
};
class base3
{
protected:
                int b3;
};
class child:public base1,protected base2,private base3
{
                int c;
public:
                void get()
                                {
                                b1=10;
                                b2=20;
                                b3=30;
                                c=40;
                                }
                void display()
                                {
                                cout<<"B1 = "<<b1<<"\nB2 = "<<b2<<"\nB3 = "<<b3<<"\nC = "<<c<<endl;
                                }
};
void main()
{
                clrscr();
                child obj;
                obj.get();
                obj.display();
                getch();
}

191

Advertisements