C++ program to check alphabet is vowel or consonant .
Vowel:j
e.g: A,a,E,e,I,i,O,o,U,u and consonant other than this alphabets.
A
#include <iostream>
using namespace std;
int main()
{
int x=1;
char user;
while(x!=0)
{
cout<<"Enter a character for chek alphabate or number and then check vowel or consunent: ";
cin>>user;
if((user>='a'&& user<='z') || (user>='A' && user<='Z'))
{
cout<<" it is an alphabet"<<"\n";
if(user=='a' || user=='e' || user=='i' || user=='o' || user=='u')
{
cout<<"You enter vowel in small alphabate"<<"\n\n";
}
else if(user=='A' || user=='E' || user=='I' || user=='U' || user=='U')
{
cout<<"You enter vowel in capital alphabate"<<"\n\n";
}
else
{
cout<<"you enter consunent"<<"\n";
}
}
else
{
cout<<user<<" is not an alphabate <<"\n\n";
}
cout<<"press 0 for exit for continue press 1"<<"\n\n";
cin>>x;
}
return 0;
Output above code:
}
Comments
Post a Comment