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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!