Career upgrade: Learn practical AI skills for better jobs and higher pay.
Level up
All Practice Exams

100+ Free C++ CPE Practice Questions

Pass your C++ Institute Certified Entry-Level Programmer exam on the first try — instant access, no signup required.

✓ No registration✓ No credit card✓ No hidden fees✓ Start practicing immediately
Not published Pass Rate
100+ Questions
100% Free
1 / 100
Question 1
Score: 0/0

Which of the following character escape sequences represents a tab character?

A
B
C
D
to track
2026 Statistics

Key Facts: C++ CPE Exam

30

Exam Questions

C++ Institute CPE-20-01 syllabus

45 min

Exam Duration

C++ Institute CPE-20-01 syllabus

70%

Passing Score (Normalized)

C++ Institute CPE-20-01 syllabus

$69

Exam Fee (USD)

C++ Institute pricing

OpenEDG TestNow

Test Provider

C++ Institute / TestNow online proctoring

Lifetime

Validity

C++ Institute certification policy

C++ Institute CPE (CPE-20-01) is a 30-item, 45-minute proctored exam delivered via OpenEDG TestNow online proctoring, with a 70% normalized passing score and a starting fee of USD 69 (USD 86 with one retake). Topics: syntax and operators (28%), flow control and functions (28%), vectors and pointers (24%), and structures and strings (20%). The certification is issued for life with no recertification required.

Sample C++ CPE Practice Questions

Try these sample questions to test your C++ CPE exam readiness. Each question includes a detailed explanation. Start the interactive quiz above for the full 100+ question experience with AI tutoring.

1Which header must be included to use std::cout and std::cin in standard C++?
A.<iostream>
B.<stdio.h>
C.<conio.h>
D.<cstdio>
Explanation: The standard streams std::cout, std::cin, std::cerr, and std::clog are declared in <iostream>. <stdio.h>/<cstdio> declare the C printf/scanf family, and <conio.h> is a non-standard Windows-only header.
2What is the output of this program? #include <iostream> int main() { int a = 7; int b = 2; std::cout << a / b << " " << a % b; return 0; }
A.3 1
B.3.5 1
C.3 0.5
D.4 1
Explanation: Both a and b are int, so / performs integer division and truncates toward zero: 7 / 2 = 3. The modulus operator % returns the integer remainder: 7 % 2 = 1. The two values are printed with a single space between them.
3Which of the following is a valid C++ identifier?
A._total2
B.2total
C.total-2
D.total 2
Explanation: A C++ identifier may consist of letters, digits, and underscores and must begin with a letter or an underscore. _total2 satisfies all three rules. Identifiers cannot start with a digit, contain hyphens, or contain whitespace.
4What value is printed by the following program? #include <iostream> int main() { int x = 10; std::cout << (x++ + ++x); return 0; }
A.22
B.21
C.20
D.23
Explanation: x++ uses the original value 10 then increments x to 11. ++x then increments x to 12 and yields 12. The expression evaluates to 10 + 12 = 22. (Note: the order in which the two sub-expressions read x is well-defined here because each side-effect on x has its own sequence point at the ; — but this style is still discouraged in real code.)
5Which literal in C++ has type double by default?
A.3.14
B.3.14f
C.3.14L
D.3
Explanation: An unsuffixed floating-point literal such as 3.14 has type double. The f suffix makes it float, the L suffix makes it long double, and 3 with no decimal point is an int.
6What does the bitwise expression (5 & 3) evaluate to?
A.1
B.7
C.8
D.0
Explanation: Bitwise AND compares bits in matching positions. 5 in binary is 101 and 3 is 011. The bits set in both numbers are only in position 0, giving 001 = 1.
7Given int x = 8; what does the expression (x << 2) produce?
A.32
B.10
C.16
D.4
Explanation: The left-shift operator shifts the bits of x to the left by 2 positions, which is equivalent to multiplying by 2^2 = 4. So 8 << 2 = 8 * 4 = 32.
8Which of the following correctly declares a constant integer named MAX with value 100?
A.const int MAX = 100;
B.constant int MAX = 100;
C.int const MAX;
D.int MAX = 100 const;
Explanation: C++ uses the keyword const, not constant. The declaration must include both the type and an initializer, since a const variable must be initialized at the point of declaration.
9What is the output of this program? #include <iostream> int main() { int a = 5; int b = 3; std::cout << (a > b ? a - b : b - a); return 0; }
A.2
B.-2
C.8
D.0
Explanation: The conditional (ternary) operator evaluates a > b first. Since 5 > 3 is true, the operator yields a - b = 5 - 3 = 2. The else branch (b - a) is not evaluated.
10What does the expression (15 ^ 9) evaluate to?
A.6
B.24
C.9
D.15
Explanation: The ^ operator is bitwise XOR: bits differ -> 1, bits match -> 0. 15 is 1111 and 9 is 1001. XOR gives 0110 = 6.

About the C++ CPE Exam

The C++ Institute CPE (CPE-20-01) credential validates the candidate's foundational ability to write, debug, and run programs in C++. The exam covers four blocks: syntax, literals, and operators (28%); flow control and functions (28%); vectors and pointers (24%); and structures and strings (20%). It is the entry-level on-ramp before the CPA Certified Associate Programmer exam.

Assessment

30 weighted single-select, multi-select, and drag-drop items (max 120 normalized points)

Time Limit

45 minutes

Passing Score

70% normalized

Exam Fee

$69 USD (C++ Institute / OpenEDG / Pearson VUE)

C++ CPE Exam Content Outline

28%

Syntax, Literals, and Operators

Built-in numeric and character types, integer/floating-point/character/string literals, the full C++ operator set with precedence and associativity, type promotion rules, basic I/O with std::cin and std::cout, and iomanip manipulators (std::setw, std::fixed, std::setprecision).

28%

Flow Control and Functions

if-else, switch with break and fall-through, while, do-while, for, range-based for (C++11+), break and continue, function definitions and prototypes, default arguments, function overloading, parameter passing by value, reference, and pointer, plus basic recursion (factorial, Fibonacci, sum).

24%

Vectors and Pointers

1D and 2D arrays, array-to-pointer decay, the address-of and dereference operators, nullptr, pointer arithmetic, dynamic memory management with new/delete and new[]/delete[], memory leaks and double-free, plus std::vector basics: construction, push_back, at, size, capacity, and range-for iteration.

20%

Structures and Strings

Struct definition with member variables, aggregate and brace initialization, dot and arrow member access, arrays of structs, passing structs to functions, plus std::string operations: length/size, substr, find, c_str, concatenation with +, comparison with ==, and getline input.

How to Pass the C++ CPE Exam

What You Need to Know

  • Passing score: 70% normalized
  • Assessment: 30 weighted single-select, multi-select, and drag-drop items (max 120 normalized points)
  • Time limit: 45 minutes
  • Exam fee: $69 USD

Keys to Passing

  • Complete 500+ practice questions
  • Score 80%+ consistently before scheduling
  • Focus on highest-weighted sections
  • Use our AI tutor for tough concepts

C++ CPE Study Tips from Top Performers

1Compile and run every code snippet you study — CPE-20-01 leans heavily on 'what does this print' and 'which line fails to compile' questions, so paper-only reasoning is not enough.
2Memorize the C++ operator precedence table cold: arithmetic before relational before logical, and prefix vs postfix increment differences trip up many candidates.
3Drill the difference between pass-by-value, pass-by-reference, and pass-by-pointer for functions, and know which one is required to mutate the caller's variable.
4Master pointer arithmetic: adding 1 to an int* advances by sizeof(int) bytes, not 1 byte — this is the foundation of array-pointer interplay.
5Practice std::vector basics until push_back, at(), size(), capacity(), and the range-for loop are second nature.
6Know std::string's main API by heart: length()/size(), substr(pos, len), find() (and the std::string::npos sentinel), c_str(), and the + and == operators.
7Learn the array-to-pointer decay rule — sizeof inside a function that received an array returns the pointer size, not the original array size.
8Treat aggregate initialization carefully: brace lists fill members in declared order and reject narrowing conversions in C++11 and later.

Frequently Asked Questions

What is on the C++ Institute CPE exam?

CPE-20-01 tests entry-level C++ across four blocks: syntax, literals, and operators (28%); flow control and functions (28%); vectors and pointers (24%); and structures and strings (20%). The exam stays at the absolute basics — no classes, inheritance, polymorphism, templates, or STL beyond std::vector and std::string. Object-oriented C++ is reserved for the CPA Certified Associate Programmer follow-on.

How long is the CPE exam and how many questions does it have?

The C++ Institute CPE-20-01 exam consists of 30 weighted items (single-select, multi-select, and drag-drop) delivered in 45 minutes, plus about 5 additional minutes for the non-disclosure agreement and tutorial. Each item carries a weight reflecting its difficulty and importance, and the final score is normalized to a maximum of 120 points (or equivalent percentage).

What is the passing score for C++ CPE?

You must achieve 70% on the CPE-20-01 normalized scoring system to pass. Because items are weighted, the 70% threshold is calculated against total points earned across all 30 items rather than a simple count of correct answers.

How much does the C++ Institute CPE exam cost?

The CPE-20-01 exam is USD 69 for a single attempt or USD 86 for the exam plus one bundled retake voucher. Candidates who complete the official CPE self-study course on the C/C++ Education Platform may earn a discount voucher.

Where do I take the CPE exam?

The CPE exam is delivered through OpenEDG TestNow, the C++ Institute's online proctoring platform, rather than at a Pearson VUE test center. You register and schedule from your edube.org account, complete the system check, and take the exam from your own computer with a webcam and microphone.

Does the CPE certification expire?

No. C++ Institute certificates, including CPE, are issued for life with no recertification or renewal fees. Once you pass CPE-20-01 your credential remains valid permanently, although the institute reserves the right to update policies in the future.