engineering computer science MCQ #2136

What is the value of `x` after `int x = 5; x = x++ + ++x;`?

engineering computer science MCQ #2136

  1. Question 1

    Q1. What is the value of `x` after `int x = 5; x = x++ + ++x;`?

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

    Answer: Undefined behavior

    Explanation: The expression involves multiple increments of x between sequence points, leading to undefined behavior.