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

Stay ahead with 100% Free CPA C++ Certified Associate Programmer CPA-21-02 Dumps Practice Questions

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

What happens when you attempt to compile and run the following code? #include #include using namespace std; int main() { string s1[]= {"How" , "to" }; s1[0].swap(s1[1]); for (int i=0; i<2; i++) { cout << s1[i]; } return( 0 ); }


Answer: B
Question 2

Which of the following expressions decrement variable i by 2? (Choose two.) 


Answer: B,C
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 << padd?>result(); return 0; }


Answer: C
Question 4

What happens when you attempt to compile and run the following code? #include using namespace std; int main() { int i, j; for(i = 0; i < 2; i++) { for(j = i; j < i + 1; j++) if(j == i) continue; else break; } cout << j; return 0; }


Answer: C
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: May 23, 2026
Add To Cart

© Copyrights TheExamsLab 2026. All Rights Reserved

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