/C-Exercises

Random Exercises with C++

C++ Exercises

Random Exercises with C++

Questions

1) Write a program that, given a date, three ints (for example, 11 27 1997), will print the number of that day within its year: i.e. Jan 1st is always 1, Dec 31st is either 365 or 366. The months of the year have lengths according to the following rules:

The odd months up to and including month 7 have 31 days. The even months from 8 upwards, have 31 days. Month 2 has 28 days except in a leap year when it has 29 days. The rest of the months have 30 days.

Credits

C++ Exercises