I'm in AP Computer Science A* I was doing the following problem:
int i = 1;
while ( i < 10 )
{
int j = 10;
while ( j > i )
j--;
i += j;
}
System.out.print(i);
The output is 16, but can someone please explain why it is 16? I tried solving it by paper and kept on getting 10. If anyone could please tell me exactly why that'd be great. Thanks :)