Simple C Program to print weekdays using switch statement with weekday number. In this C program you input any number between 1 to 7 and print name of days in week using switch case statement.
#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(); }