Why this code outputs 2 2 0? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
28th Aug 2019, 7:03 AM
_rk
_rk - avatar
3 Answers
+ 7
+ Don't do this. You should split the expression in different printf statements.
28th Aug 2019, 1:55 PM
Nikhil
Nikhil - avatar
+ 5
In your contest the result depends HIGHLY by compiler... Read here https://en.cppreference.com/w/c/language/eval_order
28th Aug 2019, 7:12 AM
KrOW
KrOW - avatar
+ 2
... or use variables and use them, after proper calculations, onto printf
28th Aug 2019, 6:50 PM
KrOW
KrOW - avatar