We know in the English Language there are only 5 Vowel and the rest are consonants vowels A, E, I, O, and U or a, e, i, o, u And Consonants B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Y, Z Or b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z So now we have to just check and match that character to given vowels.
See Also: C Program To Find Character Is Vowel Or Not
See Also: Java Program To Find Character Is Vowel Or Not
The Output of the Program to Check Vowel or Consonant
See Also: C Program To Find Character Is Vowel Or Not
C++ Program to Check Vowel or Consonant Using if Else
#include <iostream>
using namespace std;
int main()
{
/*C++ Program to Check Vowel or Consonant */
char a;
cout << "Enter The Character You Want Check Vowel or Consonan\n\n";
cin >> a;
if (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u' || a == 'A' || a == 'E' || a == 'I' || a == 'O' || a == 'U')
{
cout << "Character is Vowel \n";
}
else
{
cout << "Character is Consonant\n\n";
}
return 0;
}
See Also: Java Program To Find Character Is Vowel Or Not
The Output of the Program to Check Vowel or Consonant
Similar to Vowel or Consonant
- C++ Program To Find Greatest Among Three Numbers
- C++ Program To Check Number Is Armstrong Or Not Using If/Else Statements
- C++ Program To Find Character Is Vowel Or Not Using If/Else Statements
- C++ Program To Check Number Is Positive Or Negative
- C++ Program To Check Number Is Prime Or Not Using If/Else Statements
0 Comments: