DAYS IN A MONTH
Code :
#include<stdio.h>
int main()
{
int mon=0;
printf("=========================================\n");
printf("\t DAYS IN MONTH\n");
printf("=========================================\n");
printf("Enter month any month number (1 - 12): ");
scanf("%d", &mon);
printf("\n");
if(mon == 1)
{
printf("January 31 days.\n");
}
else if(mon == 2)
{
printf("February 28 days.\n");
}
else if(mon == 3)
{
printf("March 31 days.\n");
}
else if(mon == 4)
{
printf("April 30 days.\n");
}
else if(mon == 5)
{
printf("May 31 days.\n");
}
else if(mon == 6)
{
printf("June 30 days.\n");
}
else if(mon == 7)
{
printf("July 31 days.\n");
}
else if(mon == 8)
{
printf("August 31 days.\n");
}
else if(mon == 9)
{
printf("September 30 days.\n");
}
else if(mon == 10)
{
printf("October 31 days.\n");
}
else if(mon == 11)
{
printf("November 30 days.\n");
}
else if(mon == 12)
{
printf("December 31 days.\n");
}
else
{
printf("Error ! Invalid month number.\n");
}
printf("-----------------------------------------\n");
return 0;
}
Come again Learn again !
« iCodeBuzz »
No comments:
Post a Comment