Interviews Questions, Algorithms, Aptitude, C Interview Program, C Theory Question, Aptitude Tricks, Test Series,

Sunday, 7 April 2019

CALENDER

CALENDER :

ODD DAYS :

The number of days more than the complete weeks are called odd days in a given period.

LEAP YEAR :
A leap year has 366 days. In a leap year, the month of February has 29 days. Every year divisible by 4 is a leap year if it is not a century. Every 4th century is a leap year and no other century is a leap year.

Examples:

Each of the years 1948, 2004, 1676 etc. is
a leap year.

Each of the years 400, 800, 1200, 1600, 2000 etc. is a leap year.

None of the years 2001, 2002, 2003, 2005,1800, 2100 is a leap year.

ORDINARY YEAR :
The year which is not a leap year is called an ordinary year. An ordinary year has 365 days.

COUNTING OF ODD DAYS :
  • 1 ordinary year = 365 days = (52 weeks + 1 day)
  • 1 ordinary year has 1 odd day
  • 1 leap year = 366 days = (52 weeks + 2 days)
    1 leap year has 2 odd days
  • 1 leap year has 2 odd days
  • 100 years = 76 ordinary years + 24 leap years.
  • = (76 *1 + 24 * 2) odd days = 124 odd days
  • = (17 weeks + 5 days) 5 odd days

Day Codes :
  • 0 = Sunday
  • 1 = Monday
  • 2 = Tuesday
  • 3 = Wednesday
  • 4 = Thursday
  • 5 = Friday
  • 6 = Saturday


Month Codes
  • January = 0
  • February =3
  • March = 3
  • April = 6
  • May = 1
  • June = 4
  • July = 6
  • August = 2
  • September = 5
  • October = 0
  • November = 3
  • December = 5

  • 1 year = 12 months
  • 12 months = 52 weeks
  • 1 week = 7 days
  • Ordinary Year = 52 weeks + 1 odd day
  • Leap Year = 52 weeks + 2 odd days

Odd days are the number of days more than the complete week or extra days in a year.
  • Number of odd days in 100 years = 5
  • Number of odd days in 200 years = (5 * 2) = 3 odd days
  • Number of odd days in 300 years = (5 * 3) = 1 odd day
  • Number of odd days in 400 years = (5 * 4 +1) = 0 odd day

Similarly, each one of 800 years, 1200 years, 1600 years, 2000 years etc  has 0 odd days


0 comments:

Post a Comment