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
line 11 of the code why are we doing
year = (input_year – 1) – basic_year;
We are calculating the difference between these years (input year and basic year)
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
total_days = (remaining_year365) + (leap_year366) + 1;
why we did +1??