K&R C Programs Exercise 5-8
Exercise 5-8. There is no error checking in day_of_year or month_day. Remedy this defect. K&R’s Section 5.8 defines a 2D array daytab[2][13] for days per month and two functions that convert between day-of-year and (month, day). Neither validates its inputs. Bad values (year 0, month 13, day 367) cause silent wrong results or array overruns. …