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
Get step-by-step solutions from verified subject matter experts
