Computer Applications
Give the output of the following expression:
a+= a++ + ++a + --a + a--; when a = 7;
Java
Java Operators
ICSE 2016
197 Likes
Answer
a = 39
Working
a+= a++ + ++a + --a + a--
⇒ a = a + (a++ + ++a + --a + a--)
⇒ a = 7 + (7 + 9 + 8 + 8)
⇒ a = 7 + 32
⇒ a = 39
Answered By
107 Likes
Related Questions
What will be the output of the following code?
int k=5,j=9; k+= k++ - ++j + k; System.out.println("k="+k); System.out.println("j="+j);
If int y =10 then find int z = (++y * (y++ + 5));
What is the value of y after the execution?
y+= ++y + y-- + --y; when int y=8Evaluate the following if the value of x = 7, y = 5:
x += x++ + x + ++y