Search This Blog

Sunday, 14 October 2012

Write a program in c++ to check whether a given character in vowel or not

#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

1 comment: