by Dinesh Thakur Category: C Programming (Pratical)

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.

Problem statement:
This is C Program that asks user to find out the days in a week.

  1. Declare variables.
  2. Using switch statement.
  3. Display result on the screen.

Here is C source code for check the day in a week. Output of this program shown below. 


void main()
       int a;
       printf("Enter a no. :");
                 case 1:printf("Monday");break;
                 case 2:printf("Tuesday");break;
                 case 3:printf("Wednesday");break;
                 case 4:printf("Thrusday");break;
                 case 5:printf("Friday");break;
                 case 6:printf("Saturday");break;
                 case 7:printf("Sunday");break;
                 default : printf("Invalid no.");

Check the Day in Week

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.