Hello Folks: I had previously posted this problem and someone on this forum suggested that i used s == 'a' || s == 'A' .... but what I have here completely makes sense..
Can you please take a look at it ?
#include<iostream>
#include<string>
using namespace std;
int main() {
string s;
cin>>s;
for(int i=0;i<s.length();i++) {
cout<<"length is "<<s.length()<<endl;
if (isalpha(s[i]))
if (s[i] == 'a'||'A'||'e'||'E'||'i'||'I'||'o'||'O'||'u'||'U')
cout<<s[i]<<" is a vowel"<<endl;
else
cout<<s[i]<<" is a consonant"<<endl;
if (isdigit(s[i]))
cout<<s[i]<<" is a digit"<<endl;
else
cout<<s[i]<<" is a special character"<<endl;
}
}
~
~
~
~
~
~