+ 1

C++ program to calculate the number of Sundays in a year .

The program has to calculate the no. of times a particular day (eg. Sunday/Monday/Tuesday) occurs in a given year.

17th Oct 2017, 10:57 AM
Shubhamendra Chongder
Shubhamendra Chongder - avatar
1 Antwort
+ 1
If year starts on the day or it's a leap year and it's second day is that day, 53, otherwise 52. If you need to list them, find the first one by finding which day the first of the year is and adding how ever many days are needed to get there. Add 7 days to find the next one and repeat until you reach the following year.
17th Oct 2017, 11:19 AM
John Wells
John Wells - avatar