Question: Please help me this JAVA prob... 7) a) What is the output of the following loop? int total = 9; for (int num = 1;

Please help me this JAVA prob...

7)

a) What is the output of the following loop?

int total = 9;

for (int num = 1; num <= (total / 2); num++ ){

total = total num;

System.out.println( total + + num);

}

b) What is printed by the following code fragment?

int i = 3;

int j = 2;

while ( i != 0 && j != 0 ) {

i = i / j;

j = ( j 1 ) / 2;

System.out.print ( i + + j + );

}

System.out.println( i );

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 Databases Questions!