Question: Write a program in C that determines the day number (1 - 366) in a year that provided by the user in the form of

Write a program in C that determines the day number (1 - 366) in a year that provided by the user in the form of 10/22/2012. For example, January 1, 2011 is day 1 December 31, 2011 is 365. However, December 31, 2012 is day 366 since 2012 was a leap year. You may assume that the user's input is correct and error free at this time. In order to calculate the correct day, your program must include a function called isLeap() that will determine if is a leap year. The function will return a 1 if it is a leap year and a 0 if it is not a leap year. A leap year must be determined by the following logic: A year is a leap year if it is divisible by 4 but not divisible by 100 or is divisible by 400 (ie. The year 1800 is not a leap year - it is divisible by 4 but also divisible by 100, also, it is not divisible by 400). Your program must call a displayDate() function that will display the output in the following format: Your date, January 31, 2014 is day number 31 Use if and switch statements where appropriate. Once complete, attach copy of a printed the source code and a copy of the output using the following date testing: 07/10/2000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
