Simple program, but can't find the problem

I wrote a program with a user-defined function that I want to tell me if the input letter is a vowel or not. When I run it and input a letter, it always returns that the letter is a vowel and I can't figure out why.
Here's what I have:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<iostream>

using namespace std;

bool isVowel(char letter);

int main()
{
char letter;

cout << "Please enter a letter: ";
cin >> letter;

if (isVowel(letter))
cout << letter << " is a vowel.";
else
cout << letter << " is a consonant.";

cout << endl << endl;

return 0;
}

bool isVowel(char letter)
{
if (letter == 'A' || 'a' || 'E' || 'e' || 'I' || 'i' || 'O' || 'o' || 'U' || 'u')
return true;
else
return false;
}


Thanks for your help.
You wrote the conditional as if you were writing plain English. Sorry, you have to repeat the variable and the comparison operator once for each letter.

if (letter == 'A' || letter == 'a' || letter == 'E' ...

In time you'll learn to do this check more efficiently.
I sure hope so. :) Thanks for your help.
Topic archived. No new replies allowed.