Question: write a code for this programming c 1. Write a function that determines the day number (1 to 366) in a year for a date

 write a code for this programming c 1. Write a function

write a code for this programming c

1. Write a function that determines the day number (1 to 366) in a year for a date that is provided as input data. As an example, January 1, 1994, is day 1. December 31, 1993, is day 365. December 31, 1996, is day 366, since 1996 is a leap year. A year is a leap year if it is divisible by four, except that any year divisible by 100 is a leap year only if it is divisible by 400. Your function should accept the month, day, and year as integers from main as arguments. Include an additional function leap that returns 1 if called with a leap year, o otherwise. Sample screen output: CALCULATE DAY OF YEAR Enter a date: 12 31 2004 12/31/2004 is the 366th day of 2004 Note that a leap year is a year that is divisible by 4 but not by 100 or divisible by 400. 1900 was not a leap year because it's divisible by 4 but is also divisible by 100. 2000 was a leap year because it's divisible by 400. 1904 was a leap year because it's divisible by 4 but not divisible by 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!