/*Program:Use of copy constructor
Author:Anubha Chaturvedi
Date:1/8/2012
Motive:To learn the concept of constructors*/




#include<iostream.h>
#include<conio.h>
class A
{
int x,y;
public:
A()
{
x=y=0;
}
A(int x1,int y1)
{
x=x1;
y=y1;
}
A(A& ob) /*copy constructor*/
{
x=ob.x;
y=ob.y;
}
void get()
{
cout<<"Enter the value of x &y";
cin>>x>>y;
}
void disp()
{
cout<<endl<<"the value of x & y is "<<x<<y;
}
};
void main()
{
A ob1,ob2(10,20),ob3(ob2);
clrscr();
ob1.get();
ob1.disp();
ob2.disp();
ob3.disp();
getch();
}