Break and Continue Statement
The "break" and "continue" statements are control flow statements that are commonly used in programming languages, including C++, Java, Python, and many others. These statements alter the normal flow of execution within loops, allowing for more fine-grained control over the iteration process.
The "break" statement is used to terminate the current loop and transfer control to the next statement following the loop. When encountered, the "break" statement causes an immediate exit from the loop, regardless of whether the loop condition is still true or not. This means that any remaining iterations of the loop are skipped, and the program continues execution from the point immediately after the loop.
Here's an example in Python:
for i in range(1, 10):
if i == 5:
___ _____ __________ ___ __________ ____ ___ _________ _______ _____ _______.
______ ______ ______ ______ _________ ____ ______ __________.
_______ _______ ________ _______ _____ _____ ____ _______ ________ ____ ____.
_________ ___ _________ __________ ______ __________.
_____ ___ _________ _________ ____ _______ ___.
__________ ___ ________ _________ ______.
____ ___ _________ _____ __________ __________ ____ ______ ___ ______.
______ _____ _______ ____ ______ _____ _________ __________.
______ _________ _______ _____ _____.
________ ________ _________ _________ _______ ________ _________ ________ _____ ____ ________ ___.
______ ____ _________ ______ _________ __________ _________ _________.
_______ __________ ____ ________ _____ ______ ___ ___ __________ ___ ___ _____.
______ _______ _______ _____ ___ ___ _____ ___ _______ __________ ___ ______.
_____ _____ _______ ______ __________ ______ _______ _____.
_____ ______ __________ __________ _____ ____ _____ __________ ____ __________.
_________ _____ ________ ________ _______ ______ ______ ________ ______ _____.
________ _________ _______ ____ _____ ________ _____ _________ _________.
___ ___ ________ ______ _______ _____ _______ _____.
_____ ____ ____ ________ ____ _____.
________ ______ ____ _______ _______ _________ ________ ______ ____ __________ _______.
________ _____ ___ _______ ____ ____ ___ __________ ________.
__________ _________ _________ __________ _____ __________ ____ _______ _________ _______ _______.
______ ___ __________ _____ ____ _______ ________ _________ _____.
_________ ________ __________ ___ _____ ___ __________.
____ ________ _____ _________ ____.
_____ ______ _____ _____ _________ __________ ________ ______ ________.
______ ____ _________ _____ __________ ________ _____ _________ _________ __________.
_______ _____ _______ ________ ____ _______ __________ ___ _______ ____ __________.
_________ _________ __________ _____ ________ _________ __________ _______ ____.
____ _____ __________ _________ _______ __________ ___ _______.
________ ___ ________ _______ _________ _____ _______ _____ ________.
_______ _________ ____ ________ _______ ___ _____ _______.
_____ _____ _______ ___ _____ _______ ______ _________ ___ _________ _______.
_____ ____ ________ __________ ____ _______ ________ _________ _____ _________ _____.
_____ _____ ____ ________.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required