Write a program to take input of an alphabet and print it is a vowel or not (using switch case )
Answers
Answer:
I will use c++ as a languages.
Just take an input from the user and check using one by one of you want switch case.
Explanation:
#include <iostream>
using namespace std;
int main()
{
char c;
cin>>c;
switch(c)
{
case 'a' :
{
cout <<"It is a vowel";
break;
}
case 'e' :
{
cout <<"It is a vowel";
break;
}
case 'i' :
{
cout <<"It is a vowel";
break;
}
case 'o' :
{
cout <<"It is a vowel";
break;
}
case 'u' :
{
cout <<"It is a vowel";
break;
}
default :
{
cout <<"It is a not vowel";
}
return 0:
}