+ 1
Why this code output is 3?
int x=2; y=2; z; if( ++Ă>2&&y--<2){ z=x+y; System.out.print (z)} else System.out.print(x);
4 Answers
+ 3
That's easy.
++x = 3 that is greater than 2. but second condition is y-- that is equals to 2 and it isn't smaller than 2. So it just prints x value that is equal to 3(after ++x it becomes 3)...
+ 2
--y is equal to 1, not 2
+ 1
why is --y equals to 2?
0
it says y--... first it check if y is smaller than 2(that is false ) and after decrease by one



