How does the continue statement affect the execution of a loop?
- It pauses the loop temporarily.
- It restarts the loop from the beginning.
- It skips the current iteration and continues with the next iteration.
- It terminates the loop immediately.
The continue statement in a loop skips the current iteration and continues with the next iteration. It does not terminate the loop or restart it. This is useful when you want to skip certain iterations based on a condition but continue the loop.
Loading...
Related Quiz
- What is the output of the logical NOT (!) operator when applied to a non-zero operand?
- Indirect recursion involves a function calling another function that eventually calls the original function, forming a _______.
- Which statement is best suited for selecting one of many blocks of code to be executed?
- The _______ statement is used to prematurely exit a switch-case block.
- When would you use a do-while loop over a while loop?