The switch statement is used to execute the multiple conditions.By using switch statement we don't need a lot of code.It saves time.
switch(expression) { case 1:Statement break; case 2:Statement beak; ...... default:if case is not matched }
#include void main() { int n; cout<<"enter your choice:"; cin>>n; switch(n) { 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<<"You Have Select Wrong Choice"; } }