C++ Program to Check Whether a Character is Vowel or Consonant

In this program, you will learn to check a character entered by user is Vowel or consonant.

The five letters A, E, I, O, U are called Vowels. All other characters are called as consonant.

Source Code
#include <iostream>
using namespace std;

int main()
    char ch;
    cout<<"Enter a character: ";
    if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch =='o' || ch=='O' || ch == 'u' || ch == 'U')
        cout<<"You entered a Vowel.";
        cout<<"You entered a Consonant.";
    return 0;
Enter a character: A
You entered a Vowel.

Enter a character: w
You entered a Consonant.