What is the effect of the continue statement inside a for loop?
- It pauses the loop for a second
- It terminates the loop
- It jumps to the next iteration
- It reruns the current iteration
Inside a for loop, the continue statement causes the loop to skip the rest of its body and jump immediately to the next iteration. This is particularly useful when certain conditions within the loop need to be avoided for specific iterations.
Loading...
Related Quiz
- A game has a scoring system where players earn points. The game needs a feature to evenly distribute bonus points among players and also determine any remaining points that can't be evenly distributed. Which arithmetic operator is essential to determine the number of leftover points?
- In a for loop, what will happen if the condition is omitted?
- Which keyword is used to define a function in C++?
- What is the purpose of the this pointer in C++?
- In a large-scale C++ project, two classes, Logger and FileHandler, are tightly coupled, sharing a lot of private data between them using friendship. How might you refactor these classes to reduce coupling without losing functionality?