Display the weekday by input month and day

like this
Sample display12 25Wednesday
If I understand you correctly, you want to prompt for a month and day (12 and 25 in your example), and the program should print out the day of the week for that day in the current year.

You can do this by taking advantage of a side effect of calling mktime(): http://www.cplusplus.com/reference/ctime/mktime/

What I mean is that you can ignore the return value of mktime(). You're interested in the side effect that mktime() will fill in the members of struct tm argument. In particular, it will set tm_wday to the number of days since the last Sunday.
In the absence of which year, it's Christmas Day.
Programmers can't tell the difference between Christmas and Halloween ;)
Dec 25 == Oct 31
i want input of month and then day of year 2019. Then display the weekday according to the user input
Topic archived. No new replies allowed.