Limited-Time Offer: Enjoy 60% Savings! - Ends In 0d 00h 00m 00s Coupon code: 60OFF
Welcome to QA4Exam
Logo

- Trusted Worldwide Questions & Answers

Most Recent C++ Institute CPA-21-02 Exam Questions & Answers


Prepare for the C++ Institute CPA - C++ Certified Associate Programmer Exam exam with our extensive collection of questions and answers. These practice Q&A are updated according to the latest syllabus, providing you with the tools needed to review and test your knowledge.

QA4Exam focus on the latest syllabus and exam objectives, our practice Q&A are designed to help you identify key topics and solidify your understanding. By focusing on the core curriculum, These Questions & Answers helps you cover all the essential topics, ensuring you're well-prepared for every section of the exam. Each question comes with a detailed explanation, offering valuable insights and helping you to learn from your mistakes. Whether you're looking to assess your progress or dive deeper into complex topics, our updated Q&A will provide the support you need to confidently approach the C++ Institute CPA-21-02 exam and achieve success.

The questions for CPA-21-02 were last updated on Nov 18, 2024.
  • Viewing page 1 out of 51 pages.
  • Viewing questions 1-5 out of 257 questions
Get All 257 Questions & Answers
Question No. 1

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

#include

#include

using namespace std;

class A {

public:

int age;

A () { age=5; };

};

class B : private A {

string name;

public:

B () { name="Bob"; };

void Print() {

cout << name << age;

}

};

int main () {

B b,*ob;

ob = &b;

ob?>age = 10;

ob?>Print();

return 0;

}

Show Answer Hide Answer
Correct Answer: D

Question No. 2

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

#include

using namespace std;

int main()

{

int x,y=10;

float f;

f = 5.90;

cout << f << ", ";

x=f;

cout << x <<", ";

f=y;

cout << f;

return 0;

}

Show Answer Hide Answer
Correct Answer: B

Question No. 3

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

#include

#include

using namespace std;

class B;

class A {

int age;

public:

A () { age=5; };

friend class B;

};

class B {

string name;

public:

B () { name="Bob"; };

void Print(A ob) {

cout << name << ob.age;

}

};

int main () {

A a;

B b;

b.Print(a);

return 0;

}

Show Answer Hide Answer
Correct Answer: A

Question No. 4

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

#include

using namespace std;

int op(int x, int y);

int main()

{

int i=2, j=2, k;

float f=0.3;

k = op(i, j);

cout<< k << "," << op(1, f);

return 0;

}

int op(int x, int y)

{

return x+y;

}

Show Answer Hide Answer
Correct Answer: A

Question No. 5

What is the output of the program?

#include

#include

using namespace std;

int main()

{

string s1[]= {"Hello" , "World" };

for (int i=0; i<2; i++) {

cout << s1[i];

}

return( 0 );

}

Show Answer Hide Answer
Correct Answer: A

Unlock All Questions for C++ Institute CPA-21-02 Exam

Full Exam Access, Actual Exam Questions, Validated Answers, Anytime Anywhere, No Download Limits, No Practice Limits

Get All 257 Questions & Answers