0
Pls why is the answer 16
x = 8; y = 7; x++(x changes to 9) x += y--(therefore x = 9 + 6) so pls can someone tell me how the answer is 16 tho :( what did i miss out
6 Respuestas
+ 5
y is 7, not 6.
+ 3
You called y before decrementing.
Your answer could give 15 if your last statement was:
x += --y
+ 3
kefas Destiny
y-- is post decrement so first it will assign the value then Decrement by 1. So here
y-- will be 7 and after assigning y will be 6
x = x + y-- = 9 + 7 = 16
and finally y = 6
+ 2
But y was decremented🤔
0
x = 8;
y = 7;
x++ // x=9
x += y--//x=9+7 -> x=16
0
Oh thanks ya'll i see it now