Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 1.51 KB

README.md

File metadata and controls

32 lines (20 loc) · 1.51 KB

Calendar-using-C

Theory For instace, consider September 13, 1857. Then , (since March is 1), , . On the other hand, for January 3, 1954, I have , , , . Note that 1953 has been redefined to run from the old March 1, 1953 to the old February 28, 1954. The days of the week will be numbered beginning with Sunday:

Remember that March 1 is now the first day of the year. Let

For instance, in 1994, March 1 was a Tuesday, so . If you know one value of , you can use it to get others. Note that

That is, increases by 1 over a normal year and by 2 over a leap year. So suppose I knew . Then for ,

The first term accounts for the one day contributed by every year, while the second term adds the extra day for each leap year. Note that since the year begins on March 1, this has to be interpreted correctly: the old 1992 was a leap year, but its extra day is contributed by the new 1991 (which extends through the old March 1, 1992). There is a similar formula using any year besides 1600.

Example. Given that , what day of the week was March 1, 1997? , and there is one intervening leap year. So

So March 1, 1997 was a Saturday.

Features of Calendar Application

  1. It displays a nicely formatted calendar of every month.
  2. You can find the day by entering the day, month and year. For example, if you enter day = 10, month = 03 and year = 1991, it gives you the day ‘Sunday’.
  3. You can add the note for a particular day.
  4. If the given month has a note in it, it will display || in that day.

OUTPUT