If x = 3, y = 7, calculate the value of:X -= X++ - ++y
Answers
Answered by
0
Answer:
9
Explanation:
x=3, y=7
first we have to know the meaning of X++ and ++X.
x++ means X value is increased by 1 after this statement.
++x means ,X value is increased by 1 instantly.
x -=(some number) means X=x-some number.
first we have to calculate the value of expression.
x++-++y = 3-8 which is -5.
here X value is 3 only even after we added with 1, the value 4 will be reflected in next usage.
coming to y, it is ++y means immediate effect 7+1=8.
total expression value is 3-8 which is -5.
next final expression is X - = -5;
which is equal to X=x-(-5)
here X value is 4.
so answer is 4+5=9.
Similar questions