Im trying to create a code that simply counts the number of vowels imputed by the user. Here's where I am.
Code:#include <iostream> using namespace std; bool isVowel(char ch); int main() { int count=0; char character; int vowelcount=0; cout << "Enter a sentence"<< endl; cout << endl; while(character !='!') { cin >> character; if(isVowel(character)==true) { vowelcount++; cout << "Vowels are " << vowelcount << endl; } if(vowelcount !=0) { cout << endl; } } cout << endl; } bool isVowel(char ch) { if ('A' == ch || 'a' == ch || 'E' == ch || 'e' == ch || 'I' == ch || 'i' == ch || 'O' == ch || 'o' == ch || 'U' == ch || 'u' == ch) { } }




Reply With Quote