Question: In this question, please write a function daysInMonth, that takes the year and month as two integer arguments and returns the number of days in

In this question, please write a function daysInMonth, that takes the year and month as two integer arguments and returns the number of days in that month. Use the function "isLeapYear" from the previous problem (you can assume that it works) to accommodate for leap years. Make sure your function is syntactically correct.

You can assume that the year will be greater than 0 and that the month will take the values [1-12].

the previous problem is written below

Everyday has 365 days in the Gregorian calendar. Because we know that the Earth takes a little longer than 365 days to orbit the Sun, we often have an extra day in Feb to correct this issue. The following statement is rule for when are leap years according to US naval observatory.

Every year can be divided by 4 is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400. For instance, years 1700, 1800 and 1900 are not leap years because of the reason stated above. However, 1600,2000,2400 are the leap years.

answer this -> Write a function isLeapYear that takes the years as an integer argument and returns 1 if it is a leap year and 0 if it is not a leap year. Make sure your function is syntactically correct.

please use C language

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!