Algorithm to Check whether Input character is a Vowel or Consonant


There are 26 alphabets in our English language. Out of which, 21 are consonants and five are vowels. The five vowels are A,E,I,O,U.

In this article, we will write an algorithm to find whether an input character is Vowel or Not.

Flowchart to check whether a character is vowel or consonant

Flowchart whether a character is vowel or consonant

Algorithm to check whether a character is vowel or consonant

Step 1: Start Step 2: Declare character type variable ch Step 3: Read ch from User Step 4: // Checking both lower and upper case vowels. IF (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch == 'o' || ch == 'O' || ch == 'u' || ch == 'U' ) Print "Vowel" ELSE Print "Consonant" Step 5: Stop

In the above algorithm,
1. We first declare a variable ch of character datatype.
2. Then we read one character from the user and store it in a variable "ch"
3. Then we compare "ch" with the vowels in both upper and lower case. If it matches we print "vowel" else we print "Consonant".


Algorithm Logic Test

Our Quiz prepared by Experts Helps you identify your knowledge in Algorithms. Everyone should atleast attempt this Quiz Once. 

Need any help in Programming? Chat with Us


2 comment
  • Rohit Chettri

    Thank you so much for uploading this.

  • Mon Isham

    Very Easy

Online Compiler
Algorithm Quiz

Only 5% Users were able to score above 75% in this Quiz. Can You Crack this?

Deals Ends in

Online Games
Play 2048 Game Online and Relax.
Play 2048 Game Online

Search Tags

    Find Whether character is Vowel or Not

    Pseudocode to check if input character is Vowel or Consonant