by Dinesh Thakur Category: Control Structures

 

 

#include<stdio.h> /* Header Files*/
#include<conio.h>
void main()
{
int a; /* variable declration */
clrscr();
printf("Enter Week day no = ");
scanf("%d",&a);
switch(a) /*test expression*/
{ case 1:
printf("Sunday");
break;
case 2:
printf("Monday");
break;
case 3:
printf("Tuesday");
break;
case 4:
printf("Wednesday");
break;
case 5:
printf("Thrusday");
break;
case 6:
printf("Friday");
break;
case 7:
printf("Staturday");
break;
default:
printf("Wrong Day NO Insert.");
}
getch();
}
 
Related Articles C Programming

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), 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.



Search Content





Popular Article