#include<iostream>
using namespace std;
class test
{
int x,y;
public:
test()
{
x=100;
y=200;
}
test(int a,int b)
{
x=a;
y=b;
}
void display()
{
cout<<"\nX is:"<<x<<"\nY is: "<<y;
}
};
int main()
{
test ob1(10,20);
test ob2;
ob1.display();
ob2.display();
return 0;
}
using namespace std;
class test
{
int x,y;
public:
test()
{
x=100;
y=200;
}
test(int a,int b)
{
x=a;
y=b;
}
void display()
{
cout<<"\nX is:"<<x<<"\nY is: "<<y;
}
};
int main()
{
test ob1(10,20);
test ob2;
ob1.display();
ob2.display();
return 0;
}
No comments:
Post a Comment