#include<iostream>
using namespace std;
class con
{
int a,b;
public:
con(int x,int y)
{
a=x;
b=y;
}
void Display()
{
cout<<"\nValue of a & b is :"<<a<<" "<<b;
}
};
int main()
{
con ob(10,20);
con ob2=ob;
ob.Display();
ob2.Display();
return 0;
}
using namespace std;
class con
{
int a,b;
public:
con(int x,int y)
{
a=x;
b=y;
}
void Display()
{
cout<<"\nValue of a & b is :"<<a<<" "<<b;
}
};
int main()
{
con ob(10,20);
con ob2=ob;
ob.Display();
ob2.Display();
return 0;
}
No comments:
Post a Comment