Statement
Statement
the for loop, structure of the for loop, nested for loops, and how to exit from the
for loop.
The for loop contains the following three optional sections, separated by a
semicolon:
Condition: The condition is a boolean expression that will return either true or
false.
If an expression evaluates to true, then it will execute the loop again;
otherwise, the loop is exited.
Iterator: The iterator defines the incremental or decremental of the loop variable.
The below figure illustrates the execution steps of the for loop.