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.

  • December 23, 2020 at 10:00 am
    Permalink

    line 11 of the code why are we doing

    year = (input_year – 1) – basic_year;

    Reply
    • December 23, 2020 at 10:36 am
      Permalink

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

      Reply
  • April 27, 2021 at 10:39 pm
    Permalink

    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
  • April 20, 2022 at 10:24 am
    Permalink

    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.