+ 1
What si the output of this code?
Int x=10; Int y =(25%7) * (++x + (18%4)); System.out.print(--y);
8 odpowiedzi
+ 5
Diego Palacio
x is 10 so ++x will be 11 because of pre increment.
So y = 4 * (11 + 2) = 52
And --y = 51 because of pre decrement
Notes: modulus operator (%) returns reminder so 25 % 7 = 4 and 18 % 4 = 2
+ 3
🅰🅹 🅐🅝🅐🅝🅣 I think you meant to say 'pre' increment and 'pre' decrement.
+ 3
Caleb change Int to int
+ 2
Why don't You check it in the playground..?
edit :
if you need explanation, read about pre increment/decrement operators....
+ 2
Thanks!! Now i understand :)
+ 2
Soumik [Busy]
Yes yes.
+ 1
You tell me
https://code.sololearn.com/cmpk78nPItU1/?ref=app
+ 1
Thanks :)