Exer4
#include
#include
void main(){
clrscr();
int day;
gotoxy(30,5);textcolor(CYAN);cprintf("*_W e L c O m e _*"); gotoxy(15,8);textcolor(MAGENTA);cprintf("Enter a number:"); scanf("%d",&day);
switch(day){
case 1: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Sunday");
break;
case 2:
gotoxy(25,10);textcolor(LIGHTRED);cprintf("Monday");
break;
case 3:
gotoxy(25,10);textcolor(LIGHTRED);cprintf("Tuesday");
break;
case 4: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Wednesday");
break;
case 5: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Thursday");
break;
case 6: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Friday");
break;
case 7: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Saturday");
break;
default:
gotoxy(20,10);textcolor(LIGHTRED);cprintf("Oops! Sorry! That day is not available!");}
getch();
}
#include
void main(){
clrscr();
int day;
gotoxy(30,5);textcolor(CYAN);cprintf("*_W e L c O m e _*"); gotoxy(15,8);textcolor(MAGENTA);cprintf("Enter a number:"); scanf("%d",&day);
switch(day){
case 1: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Sunday");
break;
case 2:
gotoxy(25,10);textcolor(LIGHTRED);cprintf("Monday");
break;
case 3:
gotoxy(25,10);textcolor(LIGHTRED);cprintf("Tuesday");
break;
case 4: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Wednesday");
break;
case 5: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Thursday");
break;
case 6: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Friday");
break;
case 7: gotoxy(25,10);textcolor(LIGHTRED);cprintf("Saturday");
break;
default:
gotoxy(20,10);textcolor(LIGHTRED);cprintf("Oops! Sorry! That day is not available!");}
getch();
}
No comments:
Post a Comment