//Problem in uderstanding associativity and in the following two situations:
1. If I write in my program
c=++a - a++ - ++a - a++;
2.If I write
printf("%d",++a - a++ - ++a - a++); //output=-26
Why does it happen?
In situation 1 value is evaluated as follows:
c=++a - a++ - ++a - a++
c=11-11 - ++a - a++
We are evaluating it from left to right.
But Associtivity of Increment(++) and decrement (--) operator is right to left.Don't you think we should evaluate it from right to left? If not please tell me why.
I will be very thankful to you for giving its answer.