C Program to Check Whether an Alphabet is Vowel or Consonant using Switch Case

In this C program, we will learn how to find whether an alphabet is vowel or not using switch case statement. A vowel is the alphabets that represents a speech sound created by the relatively free passage of breath through the larynx and oral cavity. Letters that are not vowels are consonants.

English has five proper vowel letters (A, E, I, O, U) all alphabets except these characters are consonants.

Required Knowledge


C program to check whether a character is vowel or consonant using switch statement

#include <stdio.h>  
  
int main() {  
    char c;  
    
    printf("Enter an Alphabet\n");  
    scanf("%c", &c);  
    
    switch(c) {  
        case 'a':    
        case 'A':
        case 'e':  
        case 'E':
        case 'i':  
        case 'I':  
        case 'o':  
        case 'O':  
        case 'u':  
        case 'U': printf("%c is VOWEL", c);  
            break;  
        default: printf("%c is CONSONANT", c);  
    }  
  
    return 0;  
}
Output
Enter an Alphabet
e
e is VOWEL
Enter an Alphabet
Z
Z is CONSONANT

Related Topics
C program to find maximum of two numbers using switch statement
C program to check whether a number is odd or even using switch statement
C program to print name of days in week using switch statement
C program to check a number is odd or even using conditional operator
C program to check decimal digit character using conditional operator
C program to calculate area of a parallelogram
C program to make a simple calculator using switch statement
C program to convert temperature from celsius to fahrenheit
C program to reverse a number using recursion
List of all C programs