Note: Do This using only nested if-else.
Sample Input:
Please Enter a character: a
Output:
Vowel
#include <iostream>
using namespace std;
int main()
{
char aplphabet;
cout<<"Please Enter a character: ";
cin>>aplphabet;
if (aplphabet == 'a')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'e')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'i')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'o')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'u')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'A')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'E')
{
cout<<"Consonan=";
}
else
{
if (aplphabet == 'I')
{
cout<<"Vowel";
}
else
{
if (aplphabet == 'O')
{
cout<<"Vowel";
}
else{
if (aplphabet == 'U')
{
cout<<"Vowel";
}
else
{
cout<<"Consonant";
}
}
}
}
}
}
}
}
}
}
return 0;
}