by CodeChum Admin
We've had enough about numbers, so why don’t we try evaluating characters now?
If you know how to identify what the vowel letters are, and you know how to count up to 5, then you’re good to go!
Instructions:
Input
Multiple lines containing a character on each. It is guaranteed that all the characters are in lower case format.
c
f
a
b
c
Output
Multiple lines containing a character on each.
c
f
a
using namespace std;
int main()
{
char c;
int n=0,Flag=1;
do
{
cout<<"\n\tEnter a character: "; cin>>c;
n=n+1;
if(c=='a' ||c=='e' ||c=='i' || c=='o' ||c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U' || n>4) Flag=0;
}while(Flag==1);
}
Comments
Leave a comment