Write a C Program to find whether the alphabet is a vowel or consonant

Admin

 

Write a C Program to find whether the alphabet is a vowel or consonant



#include<stdio.h>
int main(void)
{
    char ch;
    printf("Enter an alphabet : ");
    scanf("%c",&ch);
    switch(ch)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':       
            printf("Alphabet is a vowel\n");
            break;
        default:
            printf("Alphabet is a consonant\n");
    }
    return 0;
}


Output


Enter an alphabet : f
Alphabet is a consonant

Enter an alphabet : e
Alphabet is a vowel


Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.