Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 00h 00m 00s Coupon code: 50OFF
Free Exam Questions

CPA-21-02 Exam Questions & Answers

CPA - C++ Certified Associate Programmer Exam  •  C++ Institute

257 Questions 65 min Updated Sep 2026 99% Pass Rate
Get Full Access

100% money-back guarantee

Sample CPA-21-02 Questions

Practice with real exam-style questions, each with the verified correct answer and explanation.

Q1 MultipleChoice

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

#include

#include

using namespace std;

int f(int i, int b);

int main()

{

int i=0;

i++;

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

{

cout<

}

return 0;

}

int f(int a, int b)

{

return a+b;

}

Correct Answer: B
Q2 MultipleChoice

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

#include

using namespace std;

int fun(int x) {

return 2*x;

}

int main(){

int i;

i = fun(1) || fun(2);

cout << i;

return 0;

}

Correct Answer: B
Q3 MultipleChoice

What is the output of the program?

#include

using namespace std;

class Base {

static int age;

public:

Base () {};

~Base () {};

void setAge(int a=10) {age = a;}

void Print() { cout << age;}

};

int Base::age=0;

int main () {

Base a,*b;

b = new Base();

a.setAge();

b?>setAge(20);

a.Print();

b?>Print();

return 0;

}

Correct Answer: A
Q4 MultipleChoice

Which code, inserted at line 12, generates the output "5b"?

#include

using namespace std;

namespace myNamespace1

{

int var = 5;

}

namespace myNamespace2

{

char var = 'b';

}

int main () {

//insert code here

return 0;

}

Correct Answer: C
Q5 MultipleChoice

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

#include

using namespace std;

int main()

{

int x=2, *y, z=3;

y = &z;

cout<

return 0;

}

Correct Answer: D

Get access to all 257 verified questions with detailed answers.

Unlock All CPA-21-02 Questions

Frequently Asked Questions

The CPA-21-02 is the C++ Certified Associate Programmer exam administered by the C++ Institute. It validates foundational knowledge of C++ programming language and is designed for developers seeking to demonstrate their competency in basic C++ concepts and syntax.

The exam covers fundamental C++ programming concepts including data types, control flow structures, functions, arrays, pointers, and basic object-oriented programming principles. It also includes topics on standard library usage and basic memory management.

The CPA-21-02 exam typically consists of 40 multiple-choice questions and candidates have 70 minutes to complete it. A passing score is generally 70% or higher, though specific requirements may vary by testing center.

This certification is ideal for beginner to intermediate programmers who want to validate their C++ knowledge and enhance their professional credentials. It's suitable for students, recent graduates, and developers transitioning to C++ from other programming languages.

Preparation typically involves studying C++ fundamentals through official study guides, online courses, and practice exams provided by the C++ Institute. Hands-on coding practice and reviewing sample questions are essential to build confidence and reinforce key concepts before the exam.
Exam Details
  • Exam CodeCPA-21-02
  • VendorC++ Institute
  • Total Questions257
  • Duration65 min
  • LanguageEnglish
  • Last UpdatedSep 5, 2026
4.9/5

Pass CPA-21-02 First Time

Get all 257 exam questions with verified answers and 90-day free updates.

Buy Now & Pass
  • PDF + Practice Test Bundle
  • 90-Day Free Updates
  • 100% Money-Back Guarantee
  • Instant Download
  • 24/7 Customer Support
99% Pass Rate Trusted by 50,000+ IT professionals