write a C program to check date of birth
Answers
Answered by
0
Answer:Pick a year as base year where January 1st falls on a Monday. We are using 1900 as base year in our program.
Then we find the number of years after base year. Day of the week in the beginning of the year shifts by 1 in every non leap year. 365 days -> 52 * 7 + 1.
Once we know on what day a given year started, we can calculate each month’s starting day.
From there it’s as simple as counting the days and finding which day it is.
Explanation:
Similar questions