day of a week.
#include <iostream>
using namespace std;
int main ()
{
int a;
cout<<"enter a week number from 1-7: ";cin >> a;
switch(a)
{
case 1:cout<< "The day is Monday"; break;
case 2:cout<< "The day is Tuesday"; break;
case 3:cout<< "The day is Wednesday";break;
case 4:cout<< "The day is Thursday"; break;
case 5:cout<< "The day is Friday"; break;
case 6:cout<< "The day is Saturday"; break;
case 7:cout<< "The day is Sunday"; break;
default:cout<<"Wrong Input \nEnter a value b/w 1-7";
}
return 0;
}
0 Comments
Post a Comment