0
What is the output of the following C++ program?
#include <iostream>
using namespace std;
class V {
public:
int x, y;
V(int a, int b) : x(a), y(b) {}
V operator+(const V& o) const { return V(x + o.x, y * o.y); }
};
int main() {
V a(1, 2), b(3, 4);
V c = a + b + a;
cout << c.x << " " << c.y;
return 0;
}- A5 32
- B5 8
- C4 16
- D5 16
Correct answer: D