Write a program that convert entered month number to month name

Write a program that convert entered month number to month name

Object:- Write a program that convert entered month number to month name.

#include <stdio.h>
#include <conio.h>
int main() {
int m_num;
printf("Enter month number to show month name:");
scanf("%d",&m_num);
if (m_num==1)
{
printf("Month is January");
}
else if (m_num==2)
{
printf("Month is Feburary");
}
else if (m_num==3)
{
printf("Month is March");
}
else if (m_num==4)
{
printf("Month is April");
}
else if (m_num==5)
{
printf("Month is May");
}
else if (m_num==6)
{
printf("Month is June");
}
else if (m_num==7)
{
printf("Month is July");
}
else if (m_num==8)
{
printf("Month is Augast");
}
else if (m_num==9)
{
printf("Month is September");
}
else if (m_num==10)
{
printf("Month is October");
}
else if (m_num==11)
{
printf("Month is November");
}
else if (m_num==12)
{
printf("Month is December");
}
else
{
printf("There are only  twelve months");
}


return 0;
}

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.