Please explain this | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
4th May 2021, 2:21 AM
Vatsav
3 Answers
+ 3
1.First prefix of x i.e. ++x evaluates (preacedence is greater than"--")and value of x will be 6 2. then x-x will be 0 3. 0-- will be -1 which assigns to z 4. last value of x will be decrements to 5 So output will be 5 -1
4th May 2021, 2:34 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
0
But -- has more priority than (+) right? So shouldn't we first decrease and then add the both
4th May 2021, 3:30 AM
Vatsav
- 1
No Vatsav unary operators (++ , --) has greater precedence than arithmetic operators !
4th May 2021, 3:35 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar