Question: Write a correct C program WITH COMMENTS to calculate and display the number of workdays for a given month. You must use another module (called
Write a correct C program WITH COMMENTS to calculate and display the number of workdays for a given month. You must use another module (called displayWorkdays()) besides the main() function. Two parameters are passed to the displayWorkdays() module which calculates and displays the total number of weekdays. The first parameter is the weekday of the first day of the given month, and the 2nd parameter is the month number. The displayWorkdays() module is called inside the main() function in the format like displayWorkdays(3, 8); Assume that 1) the first parameter has the following values: 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, 4 for Thursday, 5 for Friday and 6 for Saturday; 2) the second parameter has the following values: 1 for January, 2 for February, and so forth; and 3) there are 28 days for February whether it is a leap year or not. Your main() function should prompt the user for the weekday of the first day of the month, and the month. Your code should be able to handle any combinations of the two values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
