if (x > 0)
x--;
y++;Why is this misleading?
- A
Both statements depend on the if
- B
x-- never executes
- Ccheck_circle
Only x-- depends on the if; y++ always runs
- D
Compile error due to missing braces
Explanation
Without braces, only the next single statement is part of the if. Indentation is ignored, so y++ runs unconditionally.