Write a C++ program to add two numbers using constructor? Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8 All Questions › Category: Cpp Language › Write a C++ program to add two numbers using constructor? 0 Vote Up Vote Down Chetan Shidling Staff asked 6 years ago I need short information. 1 Answers 1 Vote Up Vote Down Chetan Shidling Staff answered 6 years ago 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