I am having trouble with my program, there's something wrong in how it counts vowels and consonants
#include<iostream>
using namespace std;
int main(){
int num[10],even = 0,odd = 0;
char choice;
int vowelcount = 0;
int concount = 0;
string word;
cout<<"MENU:"<<endl<<"[N]umber"<<endl<<"[L]etter"<<endl<<"Choice : ";
cin>>choice;
switch(choice){
case 'n': case 'N':
cout << "Enter 10 integers: \n";
for(int i = 0; i < 10; i++) {
cin >> num[i];
if((num[i] % 2) == 0) {
even++;
}
}
odd = 10 - even;
cout << "Even: " << even << endl;
cout << "Odd: " << odd << endl;
system("pause");
cout<<"Do you want to repeat the program ? Y/N ";
break;
case 'l': case 'L':
cout<< "Enter 10 Letters : \n";
cin>> word;
for (int i=0; word [i] != '\0'; i++){
word[i] = tolower (word[i]);
for (int i=0; word [i] != '\0'; i++)
switch(choice){
case 'A' :
case 'E' :
case 'I' :
case 'O' :
case 'U' :
vowelcount++;
break;
default:
concount++;
}
}
cout<<" total vowels = " <<vowelcount << endl;
cout<<" total consonant = " <<concount << endl;
system("pause");
return 0;
}
}