C Program to Check Vowel or Consonant

Write a C Program to find vowel or consonant  using if-else statement ?

In English, A, E, I, O, and U are the five alphabets which are known as Vowels.Except these five alphabets all the remaining alphabets are called as consonants. In this tutorial, we will show you, How to write a C Program to check Vowel or Consonant with the explanation.

C Programming Code:
int main()
char alphabet;
int lowercase,highercase;
printf(“enter the charter”);
lowercase=(alphabet==’a’||alphabet==’e’|| alphabet==’i’||alphabet==’o’||alphabet==’u’);
highercase=(alphabet==’A’||alphabet==’E’|| alphabet==’I’||alphabet==’O’||alphabet==’U’);
printf(“%c is vowel\n”,alphabet);
printf(“%c is consonant\n”,alphabet);
return 0;


The user will first ask to enter any character, and then we are assigning the character to the previously declared variable.
Then, we used the If Else Statement to check whether the character entered by the user is equal to, A, E, I, O, U, for both upper and lower case. And if it is TRUE, it is a Vowel otherwise, it’s a Consonant.

Leave a comment if you have any doubt or difficulties.