Sunday, 25 March 2018

C++ program for checking vowels with switch statement

Here is the code copy and paste it on your IDE to run the program and get output.










#include<iostream>
using namespace std;
int main()
{
char num;
    cout<<"Enter a Character"<<endl;
    cin>>num;
    switch(num)
    {
    case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
        case 'A':
        case 'E':
        case 'I':
        case 'U':
        case 'O':
       
        cout<<"its vowel"<<endl;
        break;
        default:
        cout<<"not vowel"<<endl;
}
}


Output:
\