Solution of URI 1052::Month
Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problem, you will inform me by comment.
#include <stdio.h>
int main()
{
int mn;
while(scanf("%d",&mn
)
!=
EOF) {
if(mn==1)
printf("January\n");
else if(mn==2)
printf("February\n");
else if(mn==3)
printf("March\n");
else if(mn==4)
printf("April\n");
else if(mn==5)
printf("May\n");
else if(mn==6)
printf("June\n");
else if(mn==7)
printf("July\n");
else if(mn==8)
printf("August\n");
else if(mn
=
=9)
printf("September\n");
else if(mn==10)
printf("October\n");
else if(mn==11)
printf("November\n");
else if(mn==12)
printf("December\n");
}
return 0;
}
No comments