for(i = 5; i > -10; i--)
x = i + 2;
In here, actually you just need to see the last i in the for statement because x is equal to i + 2 where i will always change until -9
Simulation :
i = 5 -> x = 5 + 2 = 7
i = 4 -> x = 4 + 2 = 6
.
.
i = -9 ->x = -9 + 2 = -7
As you can see, x equal to -7 and your output is ++x, which mean you need to add 1 to x, which is x = -7 + 1 = -6
Therefore, x = -6(a)
Maybe you get -8 because you run your for until i = -10, then x will become -8 and you forget to plus 1, then your answer will be -8
//just my speculation
Nb : If there is no brace after loop state, you can just run the program below it
example :
for(int i = 0;i < 10;i++)
x++;
....
then it will only run x++;