#include<iostream.h>
#include<conio.h>
class sum
{
int a,b;
public:
sum()
{
a=b=0;
}
sum(int c,int d)
{
a=c;
b=d;
}
sum(sum & s)
{
a=s.a;
b=s.b;
}
void display()
{
cout<<a<<"\t"<<b;
}
};
void main()
{
sum s1,s2(3,5),s3(s2);
clrscr();
cout<<"\nValue of s1:";
s1.display();
cout<<"\nValue of s2:";
s2.display();
cout<<"\nValue of s3:";
s3.display();
getch();
}
No comments:
Post a Comment