posted 23 years ago
x=(b1 | b2 & b3 ^b4) ? x++ : --x;
First let us evaluate
true | ( (true & true ) ^ true )
i.e., true | (true ^ true )
i.e., true | false
i.e., true
Now, the expression is equivalent to
x = x++;
The steps are
1) Return the value of x
2) Increment the value of x
3) Assign the value returned by step 1 to L.H.S variable
So,
The value 0 is assigned to the variable x
Hope this helps...
Uma