Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the output from the System.out.println for the following code. ( To help k

ID: 3544635 • Letter: W

Question

Write the output from the System.out.println for the following code. ( To help keep track of the variables values write the variables down and the values that thery get as the code is run.)

int sum = 0 , i , j;

               i = 1;

               while ( i * j <= 16)

               {

               j = i ;

                while ( i * j < = 64)

               {

               sum = i + j;

               System.out.println( " I= " + i + " J = " + j + " sum=" + sum);

               j = j * 2;

              }

              i++;

             }

Explanation / Answer

I= 1 J = 1 sum=2

I= 1 J = 2 sum=3

I= 1 J = 4 sum=5

I= 1 J = 8 sum=9

I= 1 J = 16 sum=17

I= 1 J = 32 sum=33

I= 1 J = 64 sum=65