Write a program in C++ Using Switch Case to Check whether the given alphabet is a vowel or Not

By | August 6, 2019

Here in this program, we will code to find out whether the entered Alphabet is a Vowel or not.

C++ Program to check given Alphabet is a vowel or not using switch case:

#include <iostream.h>
#include<conio.h>
void main()
{
    char chr;
    cout<<"Enter an Alphabet: ";
    cin>>chr;

    switch(chr)
                {
                case 'a':
                case 'A':

                case 'e':
                case 'E':

                case 'i':
                case 'I':

                case 'o':
                case 'O':

                case 'u':
                case 'U':
                cout<<"----------------It is a Vowel-------------";
                break;
                default:
                cout<<"++++++++++++++It is not a Vowel+++++++++++";

                }

getch();

}

Output:                 

Enter an Alphabet: A

----------------It is a Vowel------------

Leave a Reply

Your email address will not be published. Required fields are marked *