Wednesday, October 19, 2011

Program:To check if a character is vowel or not (using if-else Statement)




#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char x;
cout<<"Please enter a character: ";
cin>>x;
if(x=='a'||x=='A'||x=='e'||x=='E'||x=='i'||x=='I'||x=='o'||x=='O'||x=='u'||x=='U')
cout<<x<<" is a Vowel ";
else
cout<<x<<" is a consonant ";
getch();
}

Article by
Chief-Editor

He is a tech Enthusiast, an Altruist and calm mentor. He loves to code. He is also a creative graphic designer. Do check out his designfolio @ Jasmeet.asia If you like This post, you can follow me on Twitter.



For Further Reading,
C++ Program, Control Structures, If-Else Statement

1 comments:

Unknown on November 13, 2016 at 10:04 PM said...

Very informative article.Thank you author for posting this kind of article .

http://www.wikitechy.com/view-article/vowel-checking-program-in-c-with-example-and-explanation


Both are really good,
Cheers,
Venkat

Post a Comment