#include<iostream.h>
#include<conio.h>
class demo
{
                int a,b;
public:
                demo(int y,int z)
                                {
                                a=y;
                                b=z;
                                display();
                                }
private:
                void display()
                                {
                                cout<<"A = "<<a<<endl;
                                cout<<"B = "<<b<<endl;
                                }
};
void main()
{
                clrscr();
                demo d(10,20);
                getch();
}

164

Advertisements