Multiple choice technology programming languages

What does the following code do: int c=0; cout<

  1. Undefined

  2. 01

  3. 00

  4. 10

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In C++, modifying a variable twice without an intervening sequence point causes undefined behavior. Here c++ both modifies c and yields its original value, but there's no sequence point between the two c evaluations in the cout statement. This violates sequencing rules, making the output undefined rather than predictably 01, 00, or 10.