Free CPA-21-02 Exam Questions - Easiest Way for Success

Prepare for the C++ Institute CPA-21-02 exam questions with our authentic preparation materials, including free CPA-21-02 practice exam questions and answers. TheExamsLab provides all the support you need to succeed in the CPA C++ Certified Associate Programmer CPA-21-02 exam. This dedication to student success is why we have the most satisfied CPA-21-02 certification exam candidates worldwide.

Page:    1 / 52      
Total 257 Questions | Updated On: Sep 12, 2024
Add To Cart
Question 1

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 2

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 3

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
Question 4

What is the output of the program? #include using namespace std; #define SQR(x)(x*x) int main(int argc, char *argv[]) { int x, y=2; x = SQR(y); cout << x << ", " <

return 0;

}


Answer: B
Question 5

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
Page:    1 / 52      
Total 257 Questions | Updated On: Sep 12, 2024
Add To Cart

© Copyrights TheExamsLab 2024. All Rights Reserved

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