Write a program to check the given character is vowel or not?
1
Expert's answer
2011-07-15T14:28:29-0400
#include <iostream> using namespace std;
int main() { char given_character; cout << "Please input a character: "; cin >> given_character;
bool vowel = false; switch (given_character) { & case 'a': case 'A': & case 'e': case 'E': & case 'o': case 'O': & case 'i': case 'I': & case 'u': case 'U': & vowel = true; } & & if (vowel) cout << "The given character is vowel." << endl; else& cout << "The given character isn't vowel." << endl; return 0; }
Comments
Leave a comment