OA. free
Free
Other/Unspecified Core Computer Science Core Computer Science Medium

What will be the output of the following C code?

Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.

What will be the output of the following C code?

int main() {
    int x = 10;
    int *ptr = &x;
    *ptr += *ptr += *ptr -= 5;
    printf("%d", x);
    return 0;
}
Choose one option.
Show answer & explanation
Answer: A. A) 5

Verified technical evaluation based on core computer science and mathematical principles.

Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.