Input a day of week & give required message

C program to read a day of week in digit and print appropriate message.

1: Holiday
2, 3, 4, 5: Working day
6,7: Half day


Solution:

#include<stdio.h>
int main()
{
     int n;
     printf("Enter Day of Week in Digit : ");
     scanf("%d",&n);
     printf("-------------------------------\n\t");
     switch(n)
     {
          case 1:
               printf("Holiday");
               break;
          case 2: // The output for case 2,3,4,5 is same
          case 3:
          case 4:
          case 5:
               /* Executed for above four cases.*/
               printf("Working Day");
               break;
          case 6:
          case 7:
               printf("Half Day");
               break;
     }                               
     return 0;
}


Output:

day week print message