A program in C++ to find the whether the entered character is vowel or a consonant (not-vowel) , using the control statement Switch
CODE:
CODE:
#include<iostream.h> #include<conio.h> void main() { char ch; <<endl<<endl; cout<<"Enter any character: "<<endl; cin>>ch; switch (ch) { case 'a': case 'A': cout<<"It is a vowel"; break; case 'e': case 'E': cout<<"It is a vowel"; break; case 'i': case 'I': cout<<"It is a vowel"; break; case 'o': case 'O': cout<<"It is a vowel"; break; case 'u': case 'U': cout<<"It is a vowel"; break; default: cout<<"It is a vowel"; } getch(); }
For Further Reading,
0 comments:
Post a Comment