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

CPP Exam Questions & Answers

CPP - C++ Certified Professional Programmer Exam  •  C++ Institute

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

100% money-back guarantee

Sample CPP 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

#include

using namespace std;

templatestruct Out {

ostream & out;

Out(ostream & o): out(o){}

void operator() (const T & val ) { out<

struct Add {

int operator()(int & a, int & b) {

return a+b;

}

};

int main() {

int t[]={1,2,3,4,5,6,7,8,9,10};

vector v1(t, t+10);

vector v2(10);

transform(v1.begin(), v1.end(), v2.begin(), bind1st(Add(),1));

for_each(v2.rbegin(), v2.rend(), Out(cout));cout<

return 0;

}

Program outputs:

Correct Answer: E
Q2 MultipleChoice

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

#include

#include

#include

#include

using namespace std;

int main() {

int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5};

vector v1(t, t + 15);

set s1(t, t + 15);

pair::iterator, vector::iterator > resultSet = equal(s1.begin(), s1.end(), v1.begin());

cout<<*resultSet.first<<" "<<*resultSet.second<

return 0;

}

Program outputs:

Correct Answer: D
Q3 MultipleChoice

What happens when you attempt to compile and run the following code? Choose all that apply.

#include

#include

#include

using namespace std;

class A

{

int a;

public:

A(int a) {this?>a = a; c++;}

A(const A & a) {this?>a = a.a; c++;}

~A() { c??;}

static int c;

};

int A::c(0);

int main ()

{

A* t[] = {new A(1), new A(2), new A(3),new A(4), new A(5)};

vectorv1(t, t+10);

dequed1(v1.begin(), v1.end());

d1.clear();

v1.clear();

cout<

return 0;

}

Correct Answer: B, D
Q4 MultipleChoice

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

#include

#include

#include

#include

using namespace std;

class B { int val;

public:

B(int v):val(v){}

int getV() const {return val;} bool operator > (const B & v) const { return val>v.val;} };

ostream & operator <<(ostream & out, const B & v) { out<

templatestruct Out {

ostream & out; Out(ostream & o): out(o){}

void operator() (const T & val ) { out<

int main() {

int t[]={20, 30, 10, 20, 30, 10, 20, 30, 10, 20};

deque d1(t, t+10);

sort(d1.begin(), d1.end(), greater());

pair ::iterator, deque::iterator > result = equal_range(d1.begin(), d1.end(), B(20),

greater());

for_each(result.first, result.second, Out(cout));cout<

return 0;

}

Program outputs:

Correct Answer: B
Q5 MultipleChoice

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

#include

#include

#include

using namespace std;

class A {

int a;

public:

A(int a) : a(a) {}

int getA() const { return a; } void setA(int a) { this?>a = a; }

};

int main () {

int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5};

deque d (t,t+15);

int number = count(d.begin(), d.end(), 2);

cout<< number<

return 0;

}

Program outputs:

Correct Answer: A

Get access to all 228 verified questions with detailed answers.

Unlock All CPP Questions

Frequently Asked Questions

There are no formal prerequisites to take the CPP exam, though it is recommended that candidates have solid knowledge of C++ programming concepts and practical experience. Most candidates should have completed the CPA (C++ Associate) certification or possess equivalent knowledge before attempting the CPP exam.

The CPP exam typically consists of 100 multiple-choice questions that must be completed within 150 minutes (2.5 hours). The exam is computer-based and can be taken at authorized testing centers or remotely depending on availability.

Candidates need to achieve a score of at least 70% to pass the CPP certification exam. The exam uses a scaled scoring system, so the exact number of questions that need to be answered correctly may vary based on difficulty adjustments.

The CPP exam covers advanced C++ programming concepts including object-oriented programming, templates, the Standard Template Library (STL), memory management, and advanced syntax. It also tests knowledge of modern C++ standards and best practices for professional software development.

The CPP exam typically costs between $150-$200 USD, though prices may vary by region and testing center. The CPP certification is valid for three years from the date of passing, after which candidates may need to recertify or take renewal exams to maintain their credential.
Exam Details
  • Exam CodeCPP
  • VendorC++ Institute
  • Total Questions228
  • Duration65 min
  • LanguageEnglish
  • Last UpdatedSep 4, 2026
4.9/5

Pass CPP First Time

Get all 228 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