Vowel or not C++ Program - Learn Engineering

All the news and updates relevant to Engineering. You can also Write a post here

Breaking

Tuesday, June 9, 2020

Vowel or not C++ Program




C++ PROGRAM TO CHECK WHETHER THE GIVEN CHARACTER IS VOWEL OR NOT


SAMPLE TEST CASE                                                         EXPECTED OUTPUT

              a                                                                                     a is a Vowel

              b                                                                                     b is not a Vowel



CODE


#include <iostream.h>
#include<conio.h>
void main() 
{
 clrscr();
 char ch;
 cin>>ch;
 if(ch='a'||ch='e'||ch='i'||ch='o'||ch='u'||ch='A'||ch='E'||ch='I'||ch='O'||ch='U')
 {
  cout<<ch<<"is a Vowel";
 }
 else
 {
  cout<<ch<<"is not a Vowel;
 }
 getch();  
}

No comments:

Post a Comment