Question: C Programming Write a function that takes a date and prints out what day it is. The formula for finding the day of the week

C Programming

Write a function that takes a date and prints out what day it is. The formula for finding the day of the week by entering the given year, month, and day is:

(year + year/4 - year/100 + year/400 + (13 * month + 8) / 5 + day) % 7

This result (0 ~ 6) and Sunday, Monday, ... , Saturday, and write the program. Enum can be used as one integer variable. For example, it can be used for switch, comparison, and for and while condition. The prototype of the function is as follows. enum Date getDate (int y, int m, int d); // return the value corresponding to the day of the week char * getDay (enum Date currDate); // return the string of the day corresponding to currDate Implement the following structure to store the data for this program. (where date is an enum variable representing the value from Sunday through Saturday)

struct Calendar{

int year, month, day;

enum Date date; // getDate function

char* dateString; // getDay function

};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!