C program to check input character is vowel or consonant.

Problem statement

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:

Rest of the 21 alphabhets are consonants.

Program

Output

Explanation
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.

Ankit Wasankar

Senior Java Developer
Java 11 | Microservices | Reactjs | SQL

Help others by sharing the content!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.