#include<iostream.h>
#include<conio.h>
class base
{
public:
                int i;
protected:
                int k;
};
class derived:private base
{
private:
                int j;
public:
                void get()
                                {
                                i=10;
                                j=20;
                                k=30;
                                }
                void display()
                                {
                                cout<<"I = "<<i<<endl;
                                cout<<"J = "<<j<<endl;
                                cout<<"K = "<<k<<endl;
                                }
};
void main()
{
                clrscr();
                derived d;
                d.get();
                d.display();
                getch();
}

188

Advertisements