Ok so I just read up on cases. I made a program that is supposed to say if something is a vowel or consonant. Its not running right for some reason. Here is the code.
Is there any way to make the first 5 cases run as one? And why isn't it telling caps apart from undercase?Code:#include <iostream> using namespace std; int main() { char letter = 0; cout << endl << "Enter a small letter: "; cin >> letter; switch(letter*(letter >= 'a' && letter <= 'z')) { case 'a': case 'e': case 'i': case 'o': case 'u': cout << endl << "You entered a vowel."; break; case '0': cout << endl << "that isn't a small letter!"; break; default: cout << endl << "You entered a consonant!"; } cout<<endl; return 0; }