Once the user enters a valid input (two integers separated by a space), print out the calendar in a format be similar to the output of the UNIX cal command. For example, if the user enters 03 2014, the output should be:
https://i.stack.imgur.com/dXG8q.jpg
I realized i asked a similar question to this prior, however i could not understand the answer at all. I feel that i should start from the basics so that i can learn myself how to print out a monthly calendar from the basis when given an input of a month and year.
I have provided code below that can only print out the following month of march, as we incorporate the the fact that each different month of each different year starts on a different day the code becomes ever more complicated so i was wondering how i should even begin to do this code.
Please nothing to advanced as my professor would not like me using things that are far ahead of my level of knowledge.
#include <stdio.h>
int main()
{
int k, rmd;
printf(" March 2014\n");
printf(" Su Mo Tu We Th Fr Sa\n");
for(k=1;k<32;++k){
if(k==1){
printf(" %2d\n", k);
}
else if(k%7 == 1){
printf(" %2d\n",k);
}
else{
printf(" %2d",k);
}
}
return 0;
}