For some reason it takes the string but does not show any result for the string can anybody help?
#include
#include
#include
#include
using namespace std;
bool IsVowel(char c);
int main(int argc, char *argv[])
{
int VowelCount = 0;
cout << "Enter a string of text: " << endl << flush;
char c;
while (cin.get(c)) {
if (IsVowel(c))
VowelCount++;
}
cout << endl << endl;
cout << "There were " << VowelCount << " vowels" << endl;
return 0;
}
bool IsVowel(char c)
{
c = toupper(c);
switch (c)
{
case 'A': case 'E': case 'I':
case 'O': case 'U': case 'Y':
return true;
}
}
2007-03-18
14:00:34
·
2 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
Of course is in C++
2007-03-18
14:10:00 ·
update #1