Question: Day of the week. Write a program that takes a date as input and prints the day of the week that date falls on. Your

Day of the week. Write a program that takes a date as input and prints the day of the week that date falls on. Your program should accept three int commandline arguments: m (month), d (day), and y (year). For m, use 1 for January, 2 for February, and so forth. For output, print 0 for Sunday, 1 for Monday, 2 for Tuesday, and so forth. Use the following formulas, for the Gregorian calendar:

Yoy (14 m) /12 X = y +%/4 - Y/100 + y/400Example: On which day of the week did February 14, 2000 fall?

mo m+ 12x ((14 m) /12) - 2 do = (d +

Yoy (14 m) /12 X = y +%/4 - Y/100 + y/400 mo m+ 12x ((14 m) /12) - 2 do = (d + x + (31 x m) / 12) % 7 -

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The images provided contain the formulas for Zellers Congruence which is an algorithm devised by Chr... View full answer

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 Introduction To Programming Questions!