Question: import java.util.Scanner; public class New{ public static void main (String [] args){ int i = 0, j = 5; int s; while (j-- > 0)
import java.util.Scanner;
public class New{
public static void main (String [] args){
int i = 0, j = 5; int s;
while (j-- > 0) {
System.out.println ("J = " + j);
j--;
}
}
}
I have a basic question about the code above.
I just don't get how output is J=4 J=2 J=0
I thought the output will be J=4 J=3 J=2 J=1
Please help!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
