HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C Program to Print Day of Week Name Using Switch case ?


Q:- Write a C Program to Print Day of Week Name Using Switch case ?
      Input
        #include<stdio.h>
        #include<conio.h>
        int main()
   {
int week;
clrscr();
printf(“Enter a Week Number(1-7) =”);
scanf(“%d”,&week);
switch(week)
{
case 1 : printf(“Monday.”);
break;
case 2 : printf(“Tuesday.”);
break;
case 3 : printf(“Wednesday.”);
break;
case 4 : printf(“Thursday.”);
break;
case 5 : printf(“Friday.”);
break;
case 6 : printf(“Saturday.”);
break;
case 7 : printf(“Sunday.”);
break;
default : printf(“Invalid Input!!!!!!!!”);
}
getch();
   }


Output

Enter week Number(1-7) = 2
Tuesday.


Comments