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:
printf(“enter the charter”);
printf(“%c is vowel\n”,alphabet);
printf(“%c is consonant\n”,alphabet);
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.