SWITCH STATEMENTS
#include<iostream>
using namespace std;
int main()
{
int choice;
cout<<"enter the choice"<<"\n";
cin>>choice;
switch(choice)
{
case 1:
cout<<"1";
break;
case 2:
cout<<"2";
break;
default:
cout<<"unknown";
}
}
#include<iostream>
using namespace std;
int main()
{
int choice;
cout<<"enter the choice"<<"\n";
cin>>choice;
switch(choice)
{
case 1:
cout<<"1";
break;
case 2:
cout<<"2";
break;
default:
cout<<"unknown";
}
}
Comments
Post a Comment