#include <stdio.h>
#include <conio.h>
void main()
{
int a;
printf("enter a number: ");
scanf("%d", &a);
switch (a)
{
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
printf("%dth month has 31 days", a);
break;
case 4:
case 6:
case 9:
case 11:
printf("%dth month has 30 days", a);
break;
case 2:
printf("%dth month has 28 or 29 days", a);
break;
default:
printf("please enter a correct value");
break;
}
getch();
}
OUTPUT
Enter a number: 8
8th month has 31 days
0 Comments