Mastering C++: A Comprehensive Quiz Based on 'Thinking in C++'

Disable ads (and more) with a membership for a one time $2.99 payment

Test your C++ skills with our quiz based on Bruce Eckel's 'Thinking in C++'. Dive into object-oriented programming, advanced topics, and fundamentals. Perfect for learners and experts alike. Assess your knowledge and become a C++ master!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What must a function in C++ always end with?

  1. End keyword

  2. A return statement

  3. A semicolon

  4. Braces

The correct answer is: A return statement

A The End keyword is not part of C++ language. B: This is the correct answer as every function in C++ must return some value or use keyword void to represent no value to the calling function. C: A semicolon is used to end statements in C++ but it is not necessary to end a function with a semicolon. D: Braces are used to define a block of code, in the case of a function it defines the scope of the function but it is not necessary to end a function with braces.