View All C Programs

 Previews Example  View All C Programs Next Example 

Program to Check Vowel or Consonant in c

Alphabets a, e, i, o and u are known as vowels and all alphabets except these characters are known as consonants. This program asks user to enter a character and checks whether that character is vowel or not.
#include <stdio.h>
int main(){
  char c;
  printf("Enter an alphabet: ");
       printf("%c is a vowel.",c);
       printf("%c is a consonant.",c);
  return 0;
Enter an alphabet: i
i is a vowel.

Enter an alphabet: G
G is a consonant.