Is there a better way to after the first if statement go back to the start of the second while loop and not continue in the while loop but not to come out of it either?
I did it by adding a second while loop outside of the while loop.
Code:#include <iostream> #include <string> #include <windows.h> using namespace std; int main() { while ( 1 ) { while ( 2 ) { cout << "1\n"; if ( 1 ) { cout << "2\n"; break; } if ( 1 ) { cout << "3\n"; break; } } Sleep(1000); } return 0; }