Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The year 2015 is not a leap year and 01/01/2015 is Thursday. Following program o

ID: 3770657 • Letter: T

Question

The year 2015 is not a leap year and 01/01/2015 is Thursday. Following program outputs the weekdays (Monday, Tuesday, ...) after user input the month (integer between 1 and 12) and day (integer between 1 to 31). Write your C code as indicated in the location /* insert your code here */ to complete the program. Assume there is no input error and the functions find_day() and out_weekday() are working accordingly. #include int main() { int year, day, weekday; printf("Enter the month "); /* insert your code here */ printf("Enter the day "); /* insert your code here */ weekday = find_day(month, day); out_weekday(weekday); return 0; }

Explanation / Answer

#include int main()
{
   int year, day, weekday,month;
   printf("Enter the month ");
   scanf("%d",&month);
   /* insert your code here */
   printf("Enter the day ");
   /* insert your code here */
   scanf("%d",&day);
   weekday = find_day(month, day);
   out_weekday(weekday);
   return 0;
}