Code:while ( i != 200 ) { cout<< i <<endl; i++;
Change the while statement to while(1), which means the while loop is always true, and therefor going to repeat. Remove the cout, and i variable. Then add the ability to quit the program somehow (case or if statement), and all you do there is break; the loop.Code:return 0; } }
Also move the return 0; down under the end of the while loop, so it isn't just getting to the end of the while loop and exiting. So it should be between the two curly braces.
Code:char choice = 'n'; while (1) { cout<< "quit?" <<endl; cin >> choice; if(choice = 'y') break;BTW continue; is useful too. It will start the loop over again from the top, from where ever its encountered.Code:} return 0; }