Friday, 16 November 2012

Given Alphabet is Vowel or Consonant?


#include <iostream>
using namespace std;
int main()
{

char alpha;
cout << "Enter An Alphabet: ";
cin >> alpha;
switch (alpha)
{
case 'A':
case 'a':
cout << "You entered a vowel "<<alpha<<endl;
break;
case 'E':
case 'e':
cout << "You entered a vowel "<<alpha<<endl;
break;
case 'I':
case 'i':
cout << "You entered a vowel "<<alpha<<endl;
break;
case 'O':
case 'o':
cout << "You entered a vowel "<<alpha<<endl;
break;
case 'U':
case 'u':
cout << "You entered a vowel "<<alpha<<endl;
break;
default:
cout << "You entered a Consonant "<<alpha<<endl;
}
return 0;
}

No comments:

Post a Comment