Question: IV Programming and Implementation (30% ) 1. Program to print number of days in month using switch..case(10 marks) 1) Input month number from user, Store
IV Programming and Implementation (30% ) 1. Program to print number of days in month using switch..case(10 marks) 1) Input month number from user, Store it in some variable say month. 2) Switch the value of month i.e. switch(month) and match with cases. 3) There can be 12 possible values (choices) of month i.e. from 1 to 12. Hence, write 12 cases inside switch and one default case as else block. 4) Print 31 for case 1, 3, 5, 7, 8, 10, 12. 5) Print 30 for case 4, 6, 9, 11. 6) Print 28/29 for case 2. 7) Print invalid input for default case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
