Not sure if that's a question; if it is, just wrap the contents of main in a for(; block and add a menu option, e.g. 8 Quit, and make case 8 return 0; Then the program will quit when they select 8; this is better than having a separate Y/N prompt to continue or quit. Think about the design, if you have several tasks to perform with the program, you would want to run them one after the other then select quit when you're done; you don't want to be asked whether or not to continue after every operation.