int nChoice; while(1) { printf("Choose a Number between 0 to 9(-1 to exit):"); //i just taken -1 to exit scanf("%d", &nChoice); if(nChoice == -1) break; //Break the loop; //else //Do your work }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)