Free C++ Institute CPA-21-02 Exam Questions

Become C++ Institute Certified with updated CPA-21-02 exam questions and correct answers

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

Which code, inserted at line 8, generates the output "100"? #include using namespace std; int fun(int); int main() { int *x = new int; *x=10; //insert code here return 0; } int fun(int i) { return i*i; } 


Answer: A,B
Question 2

Which of the following operators accept integer arguments only? (Choose two.) 


Answer: A,C
Question 3

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


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


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? 


Answer: A
Page:    1 / 52      
Total 257 Questions | Updated On: Mar 07, 2026
Add To Cart

© Copyrights DumpsCertify 2026. All Rights Reserved

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