#include<iostream.h>
#include<conio.h>
void main()
{
char c;
cin>>c;
if(c>=65&&c<82)
c=c+32;
switch(c)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
cout<<"Given character is vowel"<<end|;
break;
default:
cout<<"Given character is consonant"<<end|;
}
}
Output:
A
Given character is vowel
T
Given charcter is consonant
#include<conio.h>
void main()
{
char c;
cin>>c;
if(c>=65&&c<82)
c=c+32;
switch(c)
{
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
cout<<"Given character is vowel"<<end|;
break;
default:
cout<<"Given character is consonant"<<end|;
}
}
Output:
A
Given character is vowel
T
Given charcter is consonant
Very informative article.Thank you author for posting this kind of article .
ReplyDeletehttp://www.wikitechy.com/view-article/vowel-checking-program-in-c-with-example-and-explanation
Both are really good,
Cheers,
Venkat