Which statement is used to skip the execution of the current iteration and start the next iteration in a loop?
Answer Details
The statement used to skip the execution of the current iteration and start the next iteration in a loop is the Continue statement.
In simple terms, when a loop is running, if the Continue statement is encountered, the following occurs:
The program stops executing the rest of the code inside the current iteration of the loop.
It immediately moves to the next iteration of the loop, bypassing any code that comes after the Continue statement in the current loop body.
This is particularly useful when certain conditions are met, and you want to skip over specific parts of the loop without terminating the entire loop. For example, if you are looping through numbers to find only even numbers, you might use the Continue statement to skip the code for odd numbers.