switch case c
snippet in c

switch case c

user7760

switch (expression) {
    case constant1:
      // statements
      break;

    case constant2:
      // statements
      break;

    default:
      // default statements
}

switch case c

user452

switch(expression) {

   case constant-expression  :
      statement(s);
      break; /* optional */
	
   case constant-expression  :
      statement(s);
      break; /* optional */
  
   /* you can have any number of case statements */
   default : /* Optional */
   statement(s);
}