C++ program to check vowel or consonant using if else

C++ program to check vowel or consonant using if else. Check the word is vowel or Consonant in C++ programs. This program will check the word whether it is vowel or consonant in C++. Checking the word is vowel or consonant in c++ program and print the whether the letter is vowel or not

#include <iostream>
using namespace std;
int main()
char c;
bool lowercase, Uppercase;
cout << "Enter the letter";
cin >> c;
lowercase = (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
Uppercase = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');
if (!isalpha(c))
cout<< "Its not alphabet";
else if (lowercase || Uppercase)
cout << c << " is a vowel";
cout << c << " is a consonant";

return 0;


Enter the letter


f is a consonant

What is vowel in c++

A whole number that may be split into two equal whole numbers by two. Even numbers are zero, two, four, six, and eight. aaaaa There! You just made a vowel sound. An open sound is represented by a vowel, which is a letter. In the English language, there are six vowels: a, e, I o, u, and y. The letter Y is sometimes a vowel, like in the word narrative, but it may also be a consonant, as in the word yes.

What is consonant in c++

A consonant is a sound that is not a vowel in speech. It also refers to the letters of the alphabet that represent certain sounds: consonants include Z, B, T, G, and H. All non-vowel sounds, or their equivalent letters, are consonants: A, E, I, O, U, and occasionally Y are not consonants. H and T are consonants in the hat.