Back To C++ Flow of Control Index
if character entered by user is (a or e or i or o or u ) message is displayed that user has entered a vowel
and if character entered by user is other than (a,e,i,o,u) message is displayed user has not entred a vowel
//program to check whether user has entered vowel or not using if-else statement #include
#include
void main() { char ch; clrscr(); cout<<"enter a character"; cin>>ch; if((ch=='a') || (ch=='e') || (ch=='i') || (ch=='o') || (ch=='u')) { cout<<"you entered a vowel"; } else { cout<<"you have not entered a vowel"; } getch(); }