Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool isItAVowel(char letter);
- int main()
- {
- char input;
- while (1)
- {
- cout<<"Please enter a letter: (0 to quit)";
- cin >> input;
- if (input == '0') break;
- if (isItAVowel (input) )
- cout<<"Yes, your letter is a vowel."<<endl;
- else
- cout<<"No, your letter is not a vowel."<<endl;
- }
- return 0;
- }
- bool isItAVowel(char letter)
- { char vowels[10] = {'a','e','i','o','u','A','E','I','O','U'};
- bool found = false;
- char i;
- for (i = 0; i < 10; i++)
- {
- found = (vowels[i]);
- if (vowels == 'a','e','i','o','u','A','E','I','O','U')
- {
- found = true;
- }
- // Add code here:
- // Compare the letter to each element in the array
- }
- return found;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement