Calendar Problem
Calendar Problem
AUGUST - 3
SEPTEMBER - 6
OCTOBER - 1
NOVEMBER - 4
DECEMBER - 6
DAY CODE
SUNDAY - 1
MONDAY - 2
TUESDAY - 3
WEDNESDAY - 4
THURSDAY - 5
FRIDAY - 6
SATURDAY - 0
Let us take an example. The date considered is January 27,2008.
1. Take the last two digits of the year and divide the number by 4, drop the
remainder.
8/4=2
2. Add the day of the month to that number.
27 + 2 = 29
3. Add month code to the answer. Refer above for the month code.
29 + 1 = 30
4. Add century code to it. Refer above for the century code.
30 + 6 = 36
5. Take the result. Add last 2 digits of the year.
36 + 8 = 44
6. Divide the number by 7. Take only the remainder.
44 / 7 = Quotient is 6, Remainder is 2
7. Refer to the day code above. Since the remainder is 2, the day is MONDAY
So, JANUARY 27,2008 is a MONDAY.