Write a program which take input character from user and determine it is vowel or consonant.
What is vowel and consonant
The letters of the English alphabet are either vowels or consonants.
These alphabets are vowels:
A, E, I, O, U or a, e, i, o, u
Rest of the 21 alphabhets are consonants.
printf("Enter the character\n");
if((ch=='a') || (ch=='e')||(ch=='i')|| (ch=='o')|| (ch=='u'))
printf("Given character is vowel");
printf("Given character is consonant");
Enter the character
Given character is consonant
We know that there are 5 vowels. Therefore we use || operator to check multiple conditions.
If you dont know what is || and how it work then check Operators.
Then you will understand the above program.
In above program, we are checking a character with a, e, i, o, u. If anyone of these matches with input character then it is vowel else it is consonant.