Identify Vowels and Consonents


#include<iostream.h>
#include<conio.h>

void main()
{
    char ch;
    clrscr();

    cout<<"Enter ch :";
    cin>>ch;

    switch(ch)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
        case 'A':
        case 'E':
        case 'I':
        case 'O':
        case 'U':
            cout<<"Character is a vowel";
            break;

        default:
            cout<<"Character is a consonent";
    }
}
Previous Post Next Post