How to use switch with break statement in C language

Switch Statement

On this page

Switch Statement

Program to use Switch with Break Statement in C Language

#include <stdio.h>
int main()
{
  int choice;
  printf("Enter your choice : ");
  scanf("%d", &choice);
  switch (choice)
  {
  case 1:

      printf("First\n");
      break;
  case 2:
      printf("Second\n");
      break;
  case 3:
      printf("Third\n");
      break;
  default:
      printf("Wrong choice\n");
  }
  return 0;
}

Output

Enter your choice : 2
Second