+ 1

What does this mean x-++y and x-+-y

if x=2 and y=3

17th Jan 2017, 4:44 AM
Prakash kumar Verma
Prakash kumar Verma - avatar
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...
17th Jan 2017, 5:56 AM
visph
visph - avatar
+ 3
-+ = - -- = + ++ = + so the first is x-++y > x-+y > x-y = -1 second x-+-y > x--y > x+y = 5
17th Jan 2017, 4:47 AM
Kawaii
Kawaii - avatar
0
kkk thanks
17th Jan 2017, 5:12 AM
Prakash kumar Verma
Prakash kumar Verma - avatar