home
Learn
screen_rotation
#include <stdio.h> #include <conio.h> void main(){ int dayNum; clrscr(); printf("\n This is a switch statement program."); printf("\n Enter number for day: "); scanf("%d",&dayNum); switch( dayNum ){ case 0: printf("\n SUNDAY "); break; case 1: printf("\n MONDAY "); break; case 2: printf("\n TUESDAY "); break; case 3: printf("\n WEDNESDAY "); break; case 4: printf("\n THURSDAY "); break; case 5: printf("\n FRIDAY "); break; case 6: printf("\n SATURDAY "); break; default: printf("\n Enter value between 0 to 6 "); break; } getch(); }
Program Output
This is a switch statement program. Enter number for day: 4 THURSDAY