Question: When the following is executed, the output is 2, What would the programmed will do the code to get the output as 8? (Hint:

When the following is executed, the output is 2, What would the programmed will do the code to get the output as 8? (Hint: Please do not change the values) public class AnswerTest { public static void main(String[] args) { int i = 42 + 45 - int j = 5 + 5 int ansi % j; - 48 - 5; 8 + 2; System.out.printf("%d", ans); } [02 Marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
