- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Programs for practice
Following C++ program ask the user to enter an alphabet to check whether it is a vowel or not, then display the result on the screen:
Source Code: Check Vowel or Not
/* C++ Program - Check Vowel or Not */
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
char ch;
cout<<"Enter an alphabet : ";
cin>>ch;
if(ch=='a' || ch=='A' || ch=='e' || ch=='E' ||
ch=='i' || ch=='I' || ch=='o' || ch=='O' ||
ch=='u' || ch=='U')
{
cout<<"This is a vowel";
}
else
{
cout<<"This is not a vowel";
}
getch();
}
Output
Enter a alphabet: k
This is not a vowel