+ 1
Question about --i
Could you explain me why the else branch is executed? Thank you😊 https://code.sololearn.com/wc3IfCNqTuaS/?ref=app
5 Answers
+ 1
Here is preicrement operator "--i". The value of i is decreased by 1. The value of i now is 0. In the if clause it's 0 == (0 + 1) => false. So the else condition is executed.
+ 1
You are welcome 😉
0
So the equality is evaluated after the decrementation?
0
Yes, that is right. You can find more info about this here https://www.sololearn.com/learn/PHP/1803/
0
Thank you 😊