C languageC SolutionChapter 3Programming

Q4 According to the Gregorian calendar, it was Monday on the date 01/01/01. If any year is input through the keyboard write a program to find out what is the day on 1st January of this year.

Program: 72

According to the Gregorian calendar, it was Monday on the date 01/01/01. If any year is input through the keyboard write a c program to find out what is the day on 1st January of this year.

Output:

 Enter the year: 2001
 Monday

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

4 thoughts on “Q4 According to the Gregorian calendar, it was Monday on the date 01/01/01. If any year is input through the keyboard write a program to find out what is the day on 1st January of this year.

  • Majid Mujahid Hussain

    line 11 of the code why are we doing

    year = (input_year – 1) – basic_year;

    Reply
    • We are calculating the difference between these years (input year and basic year)

      Reply
  • Dhiren Kanabar

    Bro there is an error in this code,the number of leap years calculated are not satisfying for year having 2100,2200 in them…as 2100,2200,2300 are not leap years but in your program they are considered as leap year as you have directly divided by 4 for counting leap years

    Reply
  • Akash Saini

    total_days = (remaining_year365) + (leap_year366) + 1;
    why we did +1??

    Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.