Write a C++ program to check whether a character is vowel or not by using a switch Statement.
Flowchart of the program to check that a character is a vowel or not by using the switch Statement
C++ Source Code to check that a character is a vowel or not by using the switch Statement
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <iostream> using namespace std; int main() { char alpha; cout<<"enter alphabet"<<endl; cin>>alpha; switch(alpha=='a' || alpha=='e' || alpha=='i' || alpha=='o' || alpha=='u' || alpha=='A' || alpha=='E' || alpha=='I' || alpha=='O' || alpha=='U') { case 1: cout<<"its vowel"; break; case 0: cout<<"its not vowel"; break; } } |
Output
enter alphabet
e
its vowel
SFT (Shamil’s Flow Table )
Are you interested to Read about SFT(Shamil’s Flow Table)?