Wednesday, September 28, 2011

Program: To find whether the entered character is vowel or a consonant




 A program in C++ to find the whether the entered character is vowel or a consonant (not-vowel) , using the control statement Switch





CODE:
#include<iostream.h>
#include<conio.h>
void main()
{
char ch;
<<endl<<endl;
cout<<"Enter any character: "<<endl;
cin>>ch;
switch (ch)
{
case 'a':
case 'A':
cout<<"It is a vowel";
break;
case 'e':
case 'E':
cout<<"It is a vowel";
break;
case 'i':
case 'I':
cout<<"It is a vowel";
break;
case 'o':
case 'O':
cout<<"It is a vowel";
break;
case 'u':
case 'U':
cout<<"It is a vowel";
break;
default:
cout<<"It is a vowel";
}
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, Switch Statement

0 comments:

Post a Comment