Answers for "what can you put in switch case"

C#
0

switch case

switch(expression) 
{
  case x:
    // code block
    break;
  case y:
    // code block
    break;
  default:
    // code block
    break;
}
Posted by: Guest on November-26-2020
0

how to loop in switch case

do {
   menu_selection = main_menu();
   switch (menu_selection) {
   case 1 : display(primes);            break;
   case 2 : display(fibos);             break;
   case 3 : display(primes_and_fibos);  break;
   case 4 : display(primes_not_fibos);  break;
   case 5 : display(fibos_not_primes);  break;
   case 6 : search();                   break;
   case 7 : break;
   default: cout << "\nThat is an invalid option. Please try again.\n\n";
} while (condition_main != 7);
return 0;
Posted by: Guest on March-23-2022

Code answers related to "what can you put in switch case"

C# Answers by Framework

Browse Popular Code Answers by Language