Question: Can you please explain how you got the answer? 31. What will be the values of ans, x, and y after the following statements are

31. What will be the values of ans, x, and y after the following statements are executed? int ans = 0, x = 15, y =25; if ( x >= y) { ans = x + 10; Xy; } else { ans = y + 10; y + x; } ans = y= 39. What would be the value of bonus after the following statements are executed? Int bonus, sales = 1250; if (sales > 1000) bonus = 100; if (sales > 750) bonus = 50; if (sales > 500) bonus = 25: else bonus = 0; bonus =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
