62.8k views
0 votes
APPLY

1. Looking at the following loop, what does the "i < 6" mean?
for (i = 0; i < 6; i++){
forward();
}
1. Looking at the same loop above, what does the "i++" mean?

1 Answer

3 votes

Answer:

i<6 is the "end guard". This means that the loop continues while this is true, and ends when this is false.

i++ is the "continuation", it is the operation executed when the loop continues. i++ increases the value of i by one.

User Scott Conover
by
3.2k points