Write a function that calculates the day of the week for any particular date in the past or future. A typical application is to calculate the day of the week on which someone was born or some other special event occurred.
Following is a simple C function suggested by Sakamoto, Lachman, Keith and Craver to calculate day. The following function returns 0 for Sunday, 1 for Monday, etc.
Output : 1 (Monday)
See this for explanation of the above function.
This article is compiled by Dheeraj Jain and reviewed by GeeksforGeeks team. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- Tomohiko Sakamoto's Algorithm- Finding the day of the week
- Container with Most Water
- Round the given number to nearest multiple of 10
- Zeller's Congruence | Find the Day for a Date
- Find Last Digit of a^b for Large Numbers
- Count numbers from 1 to n that have 4 as a digit
- Find number of days between two given dates
- Find next greater number with same set of digits
- Expression Evaluation
- Check divisibility by 7
- Given a number, find the next smallest palindrome
- Generate integer from 1 to 7 with equal probability
- DFA based division
- Sieve of Eratosthenes
- Magic Square