Saved Bookmarks
| 1. |
e)Givetheoutputof the following program segmentsint x-10, y = 5, z = 0;if(x y )12166 39System.out.println(z+ "" X+"+y);ctho following: |
|
Answer» Output: 15 11 4Working:x>y. So condition is true and the control goes to the next statement z=++x + --y;So, x gets incremented by 1 and y gets reduced by 1 by prefix operators. So, x= 11, y= 4. z= 11+4 = 15. |
|