Write the output of the following program.
#include
using namespace std;
class simple
{
private:
int a, b;
public:
simple() //default constructor
{
a = 0; b = 0;
cout << “\n default constructor” << endl;
}
int getdata();
};
int simple :: getdata()
{int tot;
cout << “\n Enter two values”; cin >> a >> b;
tot = a + b; return tot;
}
int main()
{
int sum=0; simple s1[3];
cout << “\n\t\tObject 1 with both values \n”;
for (int i=0;i<3;i++)
sum+=s 1 [i]. getdata();
cout << “\nsum of all object values is” << sum;
return 0;
}