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.


Why might 'goto' be considered bad programming style?

  1. It can only jump forward in code

  2. It makes the program execution slower

  3. It can make the code harder to read and follow

  4. It is deprecated in modern versions of C++

The correct answer is: It can make the code harder to read and follow

The use of 'goto' can make the code more difficult to follow and understand as it allows for unexpected jumps in the code. This can lead to confusion and errors in the program. Additionally, it goes against the principle of structured programming which promotes breaking code into logical blocks and avoiding jumping between them. While options A and D may also be true, they are not the primary reasons why 'goto' is considered bad programming style. Option B is not entirely true as the execution may only be marginally slower due to the added overhead of jumping to another location in the code.