Free C++ Institute CPA-21-02 Practice Exam Questions and Answers 2026

Start Learning with the Newest and 100% Free CPA-21-02 Exam Dumps Questions

Page:    1 / 52      
Total 257 Questions | Updated On: Apr 02, 2026
Add To Cart
Question 1

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


Answer: B
Question 2

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


Answer: A
Question 3

What happens when you attempt to compile and run the following code? #include using namespace std; class Test { float i,j; }; class Add { public: int x,y; Add (int a=3, int b=3) { x=a; y=b; } int result() { return x+y;} }; int main () { Test test; Add * padd; padd = &test; cout result(); return 0; }


Answer: C
Question 4

What happens when you attempt to compile and run the following code? #include using namespace std; int op(int x, int y); int main() { float *pf; float f=0.9; pf=&f; cout


Answer: A
Question 5

What happens when you attempt to compile and run the following code? #include using namespace std; class BaseC { public: int *ptr; BaseC() { ptr = new int(10);} BaseC(int i) { ptr = new int(i); } ~BaseC() { delete ptr; } }; void fun(BaseC x); int main() { BaseC *o = new BaseC(5); fun(*o); } void fun(BaseC x) { cout


Answer: C
Page:    1 / 52      
Total 257 Questions | Updated On: Apr 02, 2026
Add To Cart

© Copyrights TheExamsLabs 2026. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLabs.