Vowel and Consonant || switch case || C programming



This is a program of Switch Case in which we are going to check whether the given character is a vowel or consonant with help of the C programming language.

#include <stdio.h>

int main()
{
    char input;
    printf("Enter a Alphabet to check whether Vowel or Consonant: ");
    scanf(" %c", &input);

    switch (input)
    {
    case 'a':
    case 'A':
    case 'e':
    case 'E':
    case 'i':
    case 'I':
    case 'o':
    case 'O':
    case 'u':
    case 'U':
        printf("You Entered a Vowel %c", input);
        break;

    default:
        printf("You Entered a Consonant %c", input);
        break;
    }
}

#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post