Please explain this code
a.)
int i=0;
while (i<10)
{
i++;
System.out.println(i);
}
Output will be: 1 2 3 4 5 6 7 8 9 10
Im confused how 10 can be an output! please explain
b.) int number = 1;
for (int i=9; i>0; i–)
}
System.out.println (number);
number ++;
}
Output will be: 1 2 3 4 5 6 7 8 9
I’m cofused how this output was reached because I got thereverse!
Expert Answer
An answer will be send to you shortly. . . . .