CPA practice question 1 of 30

What happens when you attempt to compile and run the following code? #include #include using namespace std; class A { protected: int y; public: int x,z; A() : x(1), y(2), z(0) { z = x + y; } A(int a, int b) : x(a), y(b) { z = x + y;} void Print() { cout

Full set: 220 questions
Answer options
A: It prints: 3 Correct answer
B: It prints: 0
C: It prints: 1
D: It prints: 2
Correct Answer:
A. It prints: 3
Scroll to Top