How to use switch with break statement in C language

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