A radical suggestion, instead of coding the games inside the switch, make the games functions and do something like
while(1)
{
cout << "A: To Play the number guessing game." << endl;
cout << "B: To Play the letter game." << endl;
cout << "C: To quit program." << endl;
cin >> choice;
switch (choice)
{
case 'A': case 'a': // number guessing
number_guessing();
break;
case 'B': case 'b': // letter game
letter_game();
break;
case 'C': case 'c': // exit
return 0;
default:
cout << "Correct choice please ...\n";
break;
}
}
Or perhaps use if/else if/else
... instead of switch()
.