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