Que - make a program by using switch case?
#include<iostream>
using namespace std;
int main()
{
char ch;
cout<<"enter a letter :-";
cin>>ch;
switch (ch)
{
case 'a': cout<<"vowel";break;
case 'e': cout<<"vowel";break;
case 'i': cout<<"vowel";break;
case 'o': cout<<"vowel";break;
case 'u': cout<<"vowel";break;
default : cout<<"consonants";break;
}
return 0;
}
Result:-
Tags
Switch case