I'm new to C++, I've encounter a problem where it only able to check vowel for the first element in the string. Anyone state out the problem with my code? Thanks
#include <iostream.h>
int main(){
int vowel=0,i=0;
char str[30];
cout<<"Please enter a string : ";
cin>>str[30];
while (i<=30){
switch(str[i]){
case 'a':
case 'A':
case 'e':
case 'E':
case 'i':
case 'I':
case 'o':
case 'O':
case 'u':
case 'U':
vowel++;
}
i++;
}
cout<<"The numbers of vowel available in the string is : "<<vowel<<endl;