C++ Program to Check if Given Character is Vowel or Consonant
Write C++ Program to Check if Given Character is Vowel or Consonant
// CPP Program to check if given character is vowel or consonant #include <iostream> using namespace std; int main() { char c; cout << "Enter the character :--> "; cin >> c; if(c == 'a'|| c == 'e' || c == 'i' || c == 'o' || c == 'u') { cout << "The given character is vowel"; } else { cout << "The given character is consonant"; } return 0; }
Output:
Enter the character :--> p
The given character is consonant
Enter the character :--> e
The given character is vowel