Finding Day for given Date : I have worked with a simple C program to find the Day for Given Date. For it I have wrote lot of lines to calculate the day and month and to find the kind of the given year. While Surfing I came to know about a single line code to find the day for given date. The code is as below

    ( d += m < 3 ? y --: y- 2, 23 * m / 9 + d + 4 + y / 4 - y / 100 + y / 400) % 7 ;
// 0 - Sunday, 6 - saturday
It gave correct answer for all inputs, but I couldn't understand the values used in this expression.

 1. Why the sum of day and month is checked for less than 3.
 2. Why the year is reduced by one and the condition fails it decreases the year by 2.
 3. Why the number 3, 23 and 9 are used in this expression.

Please let me know what is the logic behind this, I'm tried of seacrching the solutions.

