Here is the code I have. It prints out the current month and previous month in the correct column. Where would I go to make it print out rest of the months underneath them in order? Thanks!!
#include<stdio.h>
enum month{jan=1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec};
typedef enum month month;
month find_prev_month ( month d );
char *month_names[] = {
"December", // this is month 0 - ie, jan-1
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
};
int main() {
month d,m;
printf("Enter number of the month: ");
scanf("%d", &d);
m=find_prev_month(d);
printf("Current\t\tPrevious\n");
printf("%s\t\t%s\n",month_names[d],month_names[m]);
return 0;
}
month find_prev_month ( month d ) {
return d-1;
}