Vowel and consonants program in c++ by using switch case

 Que - make a program by using switch case?

#include<iostream>
using namespace std;

int main()
{
  
    char ch;
    cout<<"enter a letter :-";
    cin>>ch;
   
    switch (ch)
    {
    case 'a': cout<<"vowel";break;
    case 'e': cout<<"vowel";break;
    case 'i': cout<<"vowel";break;
    case 'o': cout<<"vowel";break;
    case 'u': cout<<"vowel";break;
   
    default : cout<<"consonants";break;
    }
   
    return 0;
}

Result:-




Post a Comment

Previous Post Next Post