C program example: Use the switch statement to output the corresponding month name based on the month

ww‮al.w‬utturi.com
C program example: Use the switch statement to output the corresponding month name based on the month

Use the switch statement to print the month name

#include<stdio.h>

void main()
{
    int choise;
    printf("\n Please enter a month number : ");
    scanf("%d",&choise);
    switch(choise)
    {
        case 1: printf("month: January");
                break;
        case 2: printf("month: February");
                break;
        case 3: printf("month: March");
                break;
        case 4: printf("Month: April");
                break;
        case 5: printf("Month: May");
                break;
        case 6: printf("month: June");
                break;
        case 7: printf("month: July");
                break;
        case 8: printf("month: August");
                break;
        case 9: printf("month: September");
                break;
        case 10: printf("month: October");
                break;
        case 11: printf("month: November");
                break;
        case 12: printf("month: December");
                break;
        default : printf("incorrect number");
    }

}
Created Time:2017-08-28 06:05:56  Author:lautturi