Check alpabet or vowel or not in C++ by R4R Team

What is Vowel :
The alphabet {A,E,I,O,U} and {a,e,i,o,u} is known as vowels.
Other then this alphabet are known as consonant.

program:

#include < iostream>
using namespace std;
int main()
{
char s;
cout<<"Enter any Character"<< endl;
cin>>s;
if(s=='A'||s=='E'|| s=='I' || s=='O' || s=='U'|| s=='a'||s=='e'|| s=='i' || s=='o' || s=='u')
cout<<"Character is vowel";
else
cout<<"Character is not vowel";
return 0;
}


output-

Enter any character
O
Character is vowel

Enter any character
k
Character is not vowel

-In this program, we take an input of any alphabet and check whether it is vowel or not.
- We just pass that variable in if() condition, as shown in above program,
-if this condition is true then it is vowel other it is consonant.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!