![]() |
VOOZH | about |
In English, there are 5 vowel letters and 21 consonant letters. In lowercase alphabets, 'a', 'e', 'i', 'o', and 'u' are vowels and all other characters ('b', 'c', 'd, 'f'....) are consonants. Similarly in uppercase alphabets, 'A', 'E', 'I', 'O', and 'U' are vowels, and the rest of the characters are consonants.
In this article, we will learn how to write a C program to check if a character is a vowel or consonant.
The algorithm to check vowels and consonants is simple to understand and implement. Here,
Below is the C program to find if a character is a vowel or consonant using an if-else statement.
The character A is a vowel.
In the below C program, the str array contains a list of vowels. The strchr() function is used to search for the entered character in the vowels array. If the character is found, the isVowel function returns 1, otherwise, it returns 0.
a is vowel
Refer to the complete article Program to find if a character is vowel or Consonant for more methods to check if a character is a vowel or consonant.