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.


Which operator is right-associative and combines both operation and assignment?

  1. ++

  2. ->

  3. +=

  4. %=

The correct answer is: +=

The operator "C +=" is the right-associative operator that consists of both operation and assignment. This operator is used to add a value to a variable and store the result in that same variable. In comparison, operator "A: ++" is the increment operator that only increases the value by 1 and does not assign a new value to the variable. Operator "B: ->" is used to access a member of a struct or class through a pointer, and operator "D: %=" is used to calculate the remainder of a division operation and assign that value to the variable.