0

X=4+2%-8

The expression evaluates to?

21st Oct 2018, 7:17 PM
LYDIA JENNIFER P
LYDIA JENNIFER P - avatar
1 Answer
- 1
Why was the question disliked? It is very intresting. The result will be defined by compiler. In C standart of 2003 year the behavior is implementation-defined if one of multiplicative operands (for / or %) is less than zero. 2%-8 can be 2 or -6. Then X can be 6 or -2. I got 6 :-)
21st Oct 2018, 9:01 PM
microBIG
microBIG - avatar