What happens to the control flow of a program when the break statement is encountered inside a while loop?
- The program exits
- The while loop terminates and control moves to the next statement after the loop
- The loop skips to the next iteration
- The loop starts from the beginning
When a break statement is encountered inside a while loop, the loop terminates immediately and the control moves to the next statement following the loop, regardless of the loop's condition.
Loading...
Related Quiz
- What does the term “Diamond Problem” refer to in the context of C++ inheritance?
- How does C++ enforce encapsulation and abstraction in multi-level inheritance scenarios?
- Which keyword is used to inherit a class in C++?
- What is the purpose of the this pointer in C++?
- In the context of recursion, what is a "recursive case"?