Continue quiz


C++ Quiz is written by Anders Schau Knatten with valuable input from Olve Maudal, Fernando Cacciola, other members of the ACCU, and several other contributers. If you discover any errors, or would like to contribute, please contact me at anders AT, on Twitter, or on GitHub.


What is this?

This is a simple online quiz that you can use to test your knowledge of the C++ programming language.

How do I use it?

Most of the questions will compile and have deterministic output, for these you just need to enter the output of the program in the text box. Some programs do however have a compilation error, unspecified behaviour, or undefined behaviour. In that case, select the correct alternative from the dropdown, and leave the output empty.

Which version of the standard is used?


I don't agree with an answer!

First of all, note that your compiler might not always show the same result as this site. This is in particular true for questions that have undefined behaviour, where the correct answer is "The program is undefined", but your compiler might show a plausible result. If you still think the answer is wrong, please file an issue explaining what you think is wrong, including a link to the question.

How does scoring work?

If you are taking a fixed quiz (not just answering random questions in training mode), you get one point per correct answer. If you used a hint for that question, 0.5 is subtracted from your point. For each incorrect attempt you made at that question, the point is further divided by two. For instance, if you used one hint and three incorrect attempts, you get (1 - 0.5) / (2 * 2 * 2) = 0.0625 points. As you can see, it pays to think things through rather than guessing, and using a hint is often also better than guessing.

What features are planned?

See open issues at GitHub.

How can I help?

If you know C++, by adding more questions, or joining our mailing-list If you know Python/Django/JavaScript, by extending functionality. If you know web-design, by improving the design. Please contact me at anders AT or Twitter.


We use cookies to able to show you your progress in the quiz. These cookies are only used for the site to function properly, we don't use any cookies for marketing or similar. In particular, we do not use any third party cookies. We also don't collect any personal information about you. If you do not want us to do so, please refrain from using the site.