Input the number of month (1 -12) and print the name of the month.
#include <stdio.h>
#include <conio.h>
void main ( )
{
int mon;
clrscr ( );
printf ("\n Enter the number of month..:"); scanf ("%d",&mon);
switch ( mon )
{
case 1:
printf ("\n JANUARY");
break;
case 2:
printf ("\n FEBRUARY");
break;
case 3:
printf ("\n MARCH");
break;
case 4:
printf ("\n APRIL");
break;
case 5:
printf ("\n MAY");
break;
case 6:
printf ("\n JUNE");
break;
case 7:
printf ("\n JULY");
break;
case 8:
printf ("\n AUGUST");
break;
case 9:
printf ("\n SEPTEMBER");
break;
case 10:
printf ("\n OCTOBER");
break;
case 11:
printf("\n NOVEMBER");
break;
case 12:
printf("\n DECEMBER");
break;
default:
printf("\n Wrong input.");
}
getch();
}
No comments:
Post a Comment