Continue

The Continue statement is used within a For or While loop to skip the remaining code within the current iteration of the loop and continuing the execution of code in the next iteration of the loop. Unlike Break, Continue does not terminate the loop but only skips that particular iteration.

This statement is used with an If statement within the loop to specify the condition, where the continuation is performed if the condition is met.


Example

In 9 rounds of sum adding, in each round 10 is added to a number from the range of 1 to 9; when the sum is bigger or equal to 15, another 10 is added to sum to obtain a new sum.

results matching ""

    No results matching ""