I am a beginner in C++, and I am wondering how to break out of nested loops. Is there a break(2)
?
#include <iostream>
using namespace std;
int main() {
for (int x = 5; x < 10; x++) {
for (int j = 6; j < 9; j++) {
for (int b = 7; b < 12; b++) {
// Some statements
// Is break(2) right or wrong
// or can I use 'break; break;'?
}
}
}
}