Search This Blog

Sunday, 14 October 2012

write a program to read a day of week and display name of the day. program

#include<iostream.h>
#include<conio.h>
void main()
{
int day;
cout<<"Enter day of week";
cin>>day;

switch(day)
{
case 1:
cout<<"sunday";
break;
case 2:
cout<<"Monday";
break;
case 3:
cout<<"Tuesday";
break;
case 5:
cout<<"Wednesday";
break;
case 6:
cout<<"Friday";
break;
case 7:
cout<<"Saturday";
break;
default:
cout<<"Not in a day of week";
}
getch();
}



output:
5
Thursday

No comments:

Post a Comment