+ 1
Explain me the result of - z = ++a-y--
Var a = 2 Var y = 1 z = ++a-y-- Why the answer is not : 3
5 Respostas
+ 2
Ofir Salem i am not sure what you don't understand .
++ or -- before a operand increases or decreases the value of operand in the expression first and then do assignment or any other operations .
whereas ++ or -- after a operand only change the value of operand after the current expression is evaluated .
+ 1
https://www.sololearn.com/learning/1130/
Check the comments as well if you still have any doubt.
0
Abhay i steel don't understand
0
Abhay ok, can you answer on the question in the top
0
Ofir Salem i answered how the ++ and -- works and that should answer your question as well or you can just google about how post and pre increment and decrement operators work given you still didn't understand .