CPP
#include <iostream>
Try it Yourself ➠
Alphabet is Vowel or Consonant in C++
14 May
0
Write a program (WAP) in C++ to read two numbers from keyboard(User Input) to know a character is vowel or consonant.
#include <iostream>
using namespace std;
int main()
{
char c;
cout<<"Enter an alphabet :\n";
cin>>c;
if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') {
cout<< c << "is VOWEL.\n";
}
else {
cout<< c
<< "is CONSONANT.\n";
}
return 0;
}
Try it Yourself ➠
Must Read :-
Previous article
Next article
Leave Comments
Post a Comment