First time here? Checkout the FAQ!
x
menu search
brightness_auto
more_vert
Write a C program to implement month name by accepting month number from user. ( Use switch case)
thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Best answer
#include<stdio.h>
#include <conio.h>
void main()
{
int choice;
//clrscr();
printf("\n enter the month number : ");
scanf("%d",&choice);
switch(choice)
{
case 1: printf("Month is : January");
break;
case 2: printf("Month is : February");
break;
case 3: printf("Month is : March");
break;
case 4: printf("Month is : April");
break;
case 5: printf("Month is : May");
break;
case 6: printf("Month is : June");
break;
case 7: printf("Month is : July");
break;
case 8: printf("Month is : August");
break;
case 9: printf("Month is : September");
break;
case 10: printf("Month is : October");
break;
case 11: printf("Month is : November");
break;
case 12: printf("Month is : December");
break;
default : printf("invalid number");
}
}

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike
more_vert
https://onlinegdb.com/Q33hyhZWt


open this link for ide with this code and see live output
...