Create a C program. Given that 1 Jan 2021 is a Friday, write a program that asks for a user input of the month number (1-12 for Jan-Dec, respectively) and prints the week day of 1st day of the corresponding month. You may assume the no. of days į n each month e.g.: "Thirty days hath September, April, June and November. All the rest have thirty-one, Except February, which has only twenty-eight, in one year in four, add one day more." Sample code: int daysOfMonth(int mm){ switch(mm){ case 9: case 4: case 6: case 11: www wwww return(30); case 2: ww n return(28); default: return(31); } Sample output: Enter a month number (1-12): 5 1 May 2021 is Saturday

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.3: Nested If Statements
Problem 7E
icon
Related questions
Question
100%

C PROGRAM

Create a C program. Given that 1 Jan 2021 is a Friday, write a program that asks for a user
input of the month number (1-12 for Jan-Dec, respectively) and prints the week day of 1st day of
the corresponding month.
You may assume the no. of days įn each month e.g.: "Thirty days hath September, April, June
and November. All the rest have thirty-one, Except February, which has only twenty-eight, in
one year in four, add one day more."
Sample code:
int daysOfMonth(int mm){
switch(mm){
case 9:
case 4:
case 6:
case 11:
return(30);
case 2:
return(28);
default:
return(31);
}
Sample output:
Enter a month number (1-12): 5
1 May 2021 is Saturday
Transcribed Image Text:Create a C program. Given that 1 Jan 2021 is a Friday, write a program that asks for a user input of the month number (1-12 for Jan-Dec, respectively) and prints the week day of 1st day of the corresponding month. You may assume the no. of days įn each month e.g.: "Thirty days hath September, April, June and November. All the rest have thirty-one, Except February, which has only twenty-eight, in one year in four, add one day more." Sample code: int daysOfMonth(int mm){ switch(mm){ case 9: case 4: case 6: case 11: return(30); case 2: return(28); default: return(31); } Sample output: Enter a month number (1-12): 5 1 May 2021 is Saturday
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning