This is C program that ask user to check the day in week that is been selected. For this user need to declare the variables for this and the user also uses the switch statement for choice base condition to chose the day in a week. As user declare simple switch statement each case statement for every day after declaring the case statement user ask to put a number the number will be from 1-7 otherwise it will be an invalid number. default case shows the message invalid number if the number out of case that user select.
This is C Program that asks user to find out the days in a week.
- Declare variables.
- Using switch statement.
- Display result on the screen.
Here is C source code for check the day in a week. Output of this program shown below.
printf("Enter a no. :");
default : printf("Invalid no.");