Created
June 29, 2016 23:18
-
-
Save MuddyBootsCode/710af57673365d653d0994693e340412 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#define SIZE 15 | |
int main (void) | |
{ | |
int day, month, year; | |
char cMonth[] = "averylongmonthname"; | |
puts("Please enter a date in day/month/year format."); | |
scanf("%d%*c%d%*c%d", &month, &day, &year); | |
if (year <= 16) | |
year = year + 2000; | |
else | |
year = year + 1900; | |
if (month == 1) | |
printf("January %d, %d\n", day, year); | |
else if (month == 2) | |
printf("February %d, %d\n", day, year); | |
else if (month == 3) | |
printf("March %d, %d\n", day, year); | |
else if (month == 4) | |
printf("April %d, %\ni", day, year); | |
else if (month == 5) | |
printf("May %d, %d\n", day, year); | |
else if (month == 6) | |
printf("June %d, %i\n", day, year); | |
else if (month == 7) | |
printf("July %d, %d\n", day, year); | |
else if (month == 8) | |
printf("August %d, %d\n", day, year); | |
else if (month == 9) | |
printf("September %d, %d\n", day, year); | |
else if (month == 10) | |
printf("October %d, %d\n", day, year); | |
else if (month == 11) | |
printf("November %d, %d\n", day, year); | |
else | |
printf("December %d, %d\n", day, year); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment