Multiple choice

Is there a difference between i ++ and ++I ?

  1. No difference

  2. Sometimes there is a difference, sometimes not

  3. ++i is illegal

  4. I++ is illegal

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

The postfix operator i++ returns the current value before incrementing, while the prefix operator ++i increments the value before returning it. Therefore, they behave differently in expressions.