java - the number of iterations of >>>> "for(int i=start;i<num;i++)" i -
i'm talking loops in form for(int i=0;i<5;i++)
i expecting increment statement done after check , think wrote programs depending on concept .
the problem when tried run code
`for( int = 0; i<5; i++) { system.out.println(i); }
i surprised find doesn't include 5 output 0 1 2 3 4
i'm confused think statments must executed @ order
write i<=5
:
for( int = 0; i<=5; i++) { system.out.println(i); }
output:
0 1 2 3 4 5
Comments
Post a Comment