engineering computer science MCQ #2131

What is the output of `int x = 5; x = x++ + ++x; printf('%d', x);`?

engineering computer science MCQ #2131

  1. Question 1

    Q1. What is the output of `int x = 5; x = x++ + ++x; printf('%d', x);`?

    • A) 11
    • B) 12
    • C) 13
    • D) Undefined Behavior

    Answer: Undefined Behavior

    Explanation: The expression involves multiple side effects on the same variable between sequence points, leading to undefined behavior.