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

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

Page:    1 / 52      
Total 257 Questions | Updated On: Jun 06, 2025
Add To Cart
Question 1

What happens when you attempt to compile and run the following code?



Answer: B
Question 2

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


Answer: A
Question 3

What happens when you attempt to compile and run the following code? #include using namespace std; int main() { int i=5; switch(i) { case 1: cout<<"Hello"; break; case 2: cout<<"world"; break; case 3: break; default: cout<<"End"; } return 0; }


Answer: C
Question 4

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


Answer: C
Question 5

What will be the output of the program? #include using namespace std; int fun(int); int main() { cout << fun(5); return 0; } int fun(int i) { return i*i; }


Answer: A
Page:    1 / 52      
Total 257 Questions | Updated On: Jun 06, 2025
Add To Cart

© Copyrights TheExamsLab 2025. All Rights Reserved

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