How to use switch control statement in C language

program to use switch control ststement in C language


#include <stdio.h>
int main()
{
    int choice;
    printf("Enter your choice : ");
    scanf("%d", &choice);
    switch (choice)
    {
    case 1:
        printf("first\n");
    case 2:
        printf("second\n");
    case 3:
        printf("third\n");
    default:
        printf("Wrong choice\n");
    }
    return 0;
}

output


Enter your choice : 1
first
second
third
Wrong choice