Confidently Practice Online with Free CPA-21-02 Exam Cram

Practice your CPA C++ Certified Associate Programmer certification test with free CPA-21-02 exam cram and take control of your certification preparation. At FreeExamCram, you can practice online for free using real CPA-21-02 exam dumps, verified questions, and expert-designed free online practice tests. Moreover our C++ Institute CPA-21-02 exam cram backed by our confidence-boosting refund guarantee.

Exam Code: CPA-21-02
Exam Questions: 257
CPA C++ Certified Associate Programmer
Updated: 16 Apr, 2026
Viewing Page : 1 - 26
Practicing : 1 - 5 of 257 Questions
Question 1

What happens when you attempt to compile and run the following code? #include #include using namespace std; class A { public: int x; A() { x=0;} A(int x) { this?>x=x;} }; class B : private A { public: using A::x; B() { x=1;} B(int x) {this?>x = x;} }; int main () { B c1; B c2(?5); cout << c1.x; cout << c2.x; return 0; }

Options :
Answer: B

Question 2

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) {} A(int a, int b) : x(a), y(b) { z = x * y;} void Print() { cout << z; } }; class B : public A { public: int y; B() : A() {} B(int a, int b) : A(a,b) {} void Print() { cout << z; } }; int main () { A b(2,5); b.Print(); return 0; }

Options :
Answer: A

Question 3

What happens when you attempt to compile and run the following code?


Options :
Answer: B

Question 4

What will the variable "age" be in class B? class A { int x; protected: int y; public: int age; A () { age=5; }; }; class B : public A { string name; public: B () { name="Bob"; }; void Print() { cout << name << age; } };

Options :
Answer: A

Question 5

Which code line inserted instead of the comment below will fix the program so that it produces the expected output and does not cause any memory leak? 


Options :
Answer: A

Viewing Page : 1 - 26
Practicing : 1 - 5 of 257 Questions

© Copyrights FreeExamCram 2026. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (FreeExamCram). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreeExamCram.