Code:
#include <iostream>
using namespace std;
class point
{
int x, y;
public:
point(int a1, int b1)
{
x = a1;
y = b1;
cout<<“x =”<<x<<“\n”;
cout<<“y =”<<y<<“\n”;
cout<<“X + Y =”<<x + y;
}
};
int main()
{
point t1 = point(10, 20);
return 0;
}
Output:
x =10
y =20
X + Y =30