Prefix, postfix and assignment: one statement at a time

Produce a trace table after every declaration or assignment in the program, then give the exact output. Distinguish the value yielded by x++ from the new value eventually stored in x by the end of that statement. Explain whether unary - modifies its operand.

    Finally say why this example can be traced statement by statement, while combining multiple unsequenced modifications of x inside one expression would require a separate validity check. Do not combine the increments in your answer.

#include <stdio.h>
int main(void)
{
    int x = 3;
    int a = x++;
    int b = ++x;
    x += a * 2;
    int c = -x;
    int d = x > b;
    printf("a=%d b=%d x=%d c=%d d=%d\n", a, b, x, c, d);
    return 0;
}

