C++ program to print day of a week using switch statement

C++ is a high level programming language. This program is using to print day of a week using switch statement using C++ Language. In C++ language cout function is used to print output in a screen.

Program:

#include <iostream>
using namespace std;

int main()
{
    int number;   
    cout<<"Enter Day Number (1 to 7): "; 
    cin>>number;
    switch(number)
    {
     case 1:
     cout<<"Monday";
     break;
     case 2:
     cout<<"Tuesday";
     break;
     case 3:
     cout<<"Wednesday";
     break;
     case 4:
     cout<<"Thursday";
     break;
     case 5:
     cout<<"Friday";
     break;
     case 6:
     cout<<"Saturday";
     break;
     case 7:
     cout<<"Sunday";
     break;
     default:
     cout<<"Invalid Input !!!!";
     break;
   }
}
 

Khubab Hamza

Read Previous

C++ program to print day of a week using if else statement

Read Next

C++ program to check whether number is even or odd

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular