Computer Applications
Evaluate the following if the value of x=7, y=5
x += x++ + x + ++y
Java Operators
114 Likes
Answer
x += x++ + x + ++y
⇒ x = x + (x++ + x + ++y)
⇒ x = 7 + (7 + 8 + 6)
⇒ x = 7 + 21
⇒ x = 28
Answered By
69 Likes
Related Questions
A student executes the following code to increase the value of a variable ‘x’ by 2.
He has written the following statement, which is incorrect.
x = +2;What will be the correct statement?
A. x +=2;
B. x =2;
C. x = x +2;- Only A
- Only C
- All the three
- Both A and C
Evaluate the expression when x is 4:
x += x++ * ++x % 2;