Lecture# 23 Find Week Days using Switch Statement | C++ Programming Tutorials in Urdu

Write a program that inputs a choice and show the days of week

include"iostream"
using namespace std;
main()
{
char ch;
cout<<"Enter a character = "; cin>>ch;
switch(ch)
{
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 5:
cout<<"Saturday";
break;
case 5:
cout<<"Sunday";
break;
default:
cout<<"Invalide";
}
}

Watch video for more information

Leave a Reply