How does the `continue` statement work in C?

How does the continue statement work in C?

a) Skips the current iteration of a loop
b) Stops the loop
c) Exits the loop
d) None of the above

Answer:

a) Skips the current iteration of a loop

Explanation:

The continue statement in C is used within loops to skip the rest of the code inside the loop for the current iteration and jump to the next iteration. When continue is encountered, the loop condition is re-evaluated to decide whether to proceed with the next iteration.

This is particularly useful when certain conditions are met, and you want to skip over some code without exiting the loop altogether, allowing for more precise control over loop execution.

Reference links:

https://www.rameshfadatare.com/learn-c-programming/

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top