Answer to Question #3342 in C++ for mukunda

Question #3342
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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS