Wednesday, April 8, 2015

33. Write a program to display the name of day on the basis of entered number 1 to 7.For example 1 for Sunday.


#include <stdio.h>
#include <conio.h>
void main()
{
int day;
clrscr();
printf("\n Input a your choice:-");
scanf("%d",&day);
switch(day)
{
case 1:
printf("\n SUNDAY");
break;

case 2:
printf("\n MONDAY");
break;
case 3:
printf("\n TUESDAY");
break;
case 4:
printf("\n WEDNESDAY");
break;
case 5:
printf("\n THURSDAY");
break;
case 6:
printf("\n FRIDAY");
break;
case 7:
printf("\ SATURDAY");
break;
default:
printf("\n INVALID DAY");
break;
}
getch();
}

No comments:

Post a Comment