Which keyword allows the control to exit out of the loop even if the loop condition remains true?
- break
- continue
- exit
- return
The "break" keyword is used to exit out of a loop, even if the loop condition remains true. It's commonly used when a specific condition within the loop is met, and you want to prematurely exit the loop's execution.
Loading...
Related Quiz
- Samuel is writing a C++ program and wants to ensure the program only compiles certain sections of the code when in debug mode. Which preprocessor directive can help him achieve this?
- In C++, which of the following groups of operators have the same level of precedence?
- How can you access the last element of a C++ STL vector named "myVector"?
- What is the size (in bytes) of an int data type in most C++ implementations?
- In C++11 and later, the keyword _______ can be used in a range-based for loop to avoid copying elements.