02/03/2023

C++ Program to Check Vowel or Consonant Using if Else

Write a program to determine whether the input character is a vowel or consonant or not an alphabet. In the English Language, there are only 5 vowels and the rest are Consonants. C++ program to find vowels and consonants. Your task is to check Entered character is a vowel or not. C++ Program to Check Vowel or Consonant Using if Else.

C++ Program to Check Vowel or Consonant Using if Else

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

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

The Output of Program to Check Vowel or Consonant

Similar to Vowel or Consonant


Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: