0
Why the answer is 10?
X=10 Y=5 x= --y+x-- - --x+y; Sout(x) ;
3 Answers
+ 4
Karthik Reddy Thotamgari
Here --y and --x are pre-decrement which first decrement by 1 then assign value
x-- is post decrement which first assign value then decrement by 1 in x
So finally
x = 10
y = 5
--y = 4
y = 4
x-- = 10
x = 9
but there is --x so --x = 8
x = 4 + 10 - 8 + 4 = 10
+ 1
đ
°đ
š đ
đ
đ
đ
đ
Ł updated
0
Karthik Reddy Thotamgari
How should be answer 10 when there is no value of x and y?