C Program To Determine Whether An Alphabet Letter Is A Vowel Or A Consonant

This program determines whether the character input is a vowel or a consonant.

Program to check for Vowel or Consonant

This program uses an if-else statement to determine whether the character value (entered by the user) is a vowel or a consonant. Because a user can enter an alphabet in both lowercase and uppercase, the program looks for uppercase and lowercase vowels and consonants. You should be familiar with the following C programming concepts in order to understand this program:

  • If statement in C programming
  • If…else statement in C programming
#include <stdio.h>
int main()
    char ch;
    bool isVowel = false;

    printf("Enter an alphabet: ");

    	isVowel = true;

    if (isVowel == true)
        printf("%c is a Vowel", ch);
        printf("%c is a Consonant", ch);
    return 0;


Enter an alphabet: E
E is a Vowel

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button