Thursday, 7 September 2017

/*11-D Program-8 Write a program to input number of week days (1-7) and translate to its equivalent name of the week. (1 to Monday, 2 to Tuesday……7 to Sunday)*/




#include<iostream.h>
void main()
{
   int n_o_d;


  cout<<"Enter the number of day\n";
  cin>>n_o_d;

  switch(n_o_d)
  {
case 1:
{
 cout<<" Monday \n";
 break;
}
case 2:
{
 cout<<" Tuesday \n";
 break;
}
case 3:
{
 cout<<" Wednesday \n";
 break;
}
case 4:
{
 cout<<" Thursday \n";
 break;
}
case 5:
{
 cout<<" Friday \n";
 break;
}
case 6:
{
 cout<<" Saturday\n";
 break;
}
case 7:
{
 cout<<"Sunday \n";
 break;
}
default:
{
 cout<<" Wrong Choice \n";
 break;
}
    }

No comments:

Post a Comment