#include<iostream.h>
#include<conio.h>
class code
{
int id;
public:
code()
{
}
code(int a)
{
id=a;
}
code(code & x)
{
id=x.id;
}
void display(void)
{
cout<<id;
}
};
int main()
{
clrscr();
code a(10);
code b(a);
code c=a;
code d;
d=c;
cout<<"\n\n\t Id Of A ";
a.display();
cout<<"\n\n\t Id Of A ";
b.display();
cout<<"\n\n\t Id Of A ";
c.display();
cout<<"\n\n\t Id Of A ";
d.display();
getch();
}
#include<conio.h>
class code
{
int id;
public:
code()
{
}
code(int a)
{
id=a;
}
code(code & x)
{
id=x.id;
}
void display(void)
{
cout<<id;
}
};
int main()
{
clrscr();
code a(10);
code b(a);
code c=a;
code d;
d=c;
cout<<"\n\n\t Id Of A ";
a.display();
cout<<"\n\n\t Id Of A ";
b.display();
cout<<"\n\n\t Id Of A ";
c.display();
cout<<"\n\n\t Id Of A ";
d.display();
getch();
}
No comments:
Post a Comment