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

What is the output of the program? #include #include using namespace std; struct Person { int age; }; class First { Person *person; public: First() {person = new Person; person?>age = 20; } void Print(){ cout << person?>age; } }; int main() { First t[2]; for (int i=0; i<2; i++) t[i].Print(); }

Options :
Answer: B

Question 2

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

Options :
Answer: A,C

Question 3

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; } 

Options :
Answer: A,B

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

Which statement should be added in the following program to make work it correctly? using namespace std; int main (int argc, const char * argv[]) { cout<<"Hello"; }

Options :
Answer: C

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

© Copyrights FreePDFQuestions 2026. 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.