+ 1
Why this output is 16
Int x =8; Int y=7; x++; x+=y--;
3 Antworten
+ 9
int x = 8; // x is now 8
int y = 7; // y is now 7
x++; // x++ is the same as: x = x + 1, so x is now 9
x += y--; // y-- returns y (7) and then decrements y, so x is now 16
// also, then y will be 6
+ 4
int x = 8;
int y = 7;
x++; // returns x (8), and then increment value of x
// here x is already 9
x += y--; // returns y (7), and then decrement* value of y
// 9 + 7 is 16