+ 1
What does this mean x-++y and x-+-y
if x=2 and y=3
3 RĂ©ponses
+ 4
It depends on which language:
- for Python, the previous answer from @N3tW0rK is good ( -1 and 5 )
- with JS, the previous answer is false, because of priority of increment operator ( ++ ) preceding 'y' in the first expression ^^ So, 'y' is incremented before using its value to perform the substraction, and first result equals 2 - ( 4 ) ) = -2; while the second result depends from context: calculate it before calculate first expression ( or after reinitializing 'y' ) and it's value is same than in Python, or be 6 instead 5 if you consider that 'y' equal 4 and not 3 before calcul...
+ 3
-+ = -
-- = +
++ = +
so the first is x-++y > x-+y > x-y = -1
second x-+-y > x--y > x+y = 5
0
kkk thanks