Write a program to check whether given string is vowels or consonant Test Case 1 Input (stdin) i Expected Output i is a vowel Test Case 2 Input (stdin) H Expected Output H is a consonant
#include<iostream>
#include<ctype.h>
using namespace std;
int main ()
{
char ch;
//cout << "Enter a character : ";
cin >> ch;
if (isdigit(ch))
cout << "\nThe entered character is a digit.";
else if (isalpha(ch))
{
if ((ch == 'A') || (ch == 'E')|| (ch == 'I')|| (ch == 'O')|| (ch == 'U')|| (ch == 'a')|| (ch == 'e')||
(ch == 'i')|| (ch == 'o')|| (ch == 'u'))
cout <<ch<< " is a vowel";
else
cout << ch<<" is a consonant";
}
else
cout << "\nThe entered character is a special character.";
return 0;
}