Smartly Prepare Exam with Free Online CPA-21-02 Practice Test

We offer the latest CPA-21-02 practice test designed for free and effective online CPA C++ Certified Associate Programmer certification preparation. It's a simulation of the real CPA-21-02 exam experience, built to help you understand the structure, complexity, and topics you'll face on exam day.

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

What is the output of the program if characters 'h', 'e', 'l', 'l' , 'o' and enter are supplied as input? #include #include using namespace std; void f(); int main() { f(); return 0; } void f() { char c; c = cin.get(); cout << c; if(c != '\n') f(); }

Options :
Answer: A

Question 2

How could you pass arguments to functions? 

Options :
Answer: A,B,C

Question 3

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 << op(1, *pf); return 0; } int op(int x, int y) { return x*y; }

Options :
Answer: A

Question 4

What happens if characters 'w', 'o', 'r', 'l' and 'd' are entered as input? #include #include using namespace std; int main() { string s1 = "Hello"; string s2; getline( cin, s2 ); cout << s1 + s2; return( 0 ); } 

Options :
Answer: A

Question 5

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

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

© Copyrights FreePDFQuestions 2025. All Rights Reserved

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