Pages

Saturday, 6 September 2014

Program to check for vowel or consonant using switch



// code is given below

#include<conio.h>
#include<iostream>
using namespace std;
int main()
{
      char ch;
      cout<<"Enter any character from  A to Z \n\n";
      cin>>ch;
      switch(ch)
      {
      case 'A':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'E':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'I':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'O':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'U':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'a':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'e':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'i':
           cout<<ch<<" is Vowel \n\n";
           break;
      case 'o':
           cout<<ch<<" is Vowel \n\n";
           break;  
      case 'u':
           cout<<ch<<" is Vowel \n\n";
           break;                                                
      default:
      cout<<ch<<" is Consonant \n\n";
      }
 return 0;  
                 

      }

No comments:

Post a Comment

thnx for visiting my blog