OK, I think that I am getting closer to completing this simple program which identifies whether or not a letter entered by the user is a vowel or not by using a function. The program successfully returns whether or not it is a vowel however it prints the lines in a disorderly fashion and it also shows some smiley face after the line "the letter you have entered is: " If you guys could help a NOOB clean this up it would be much appreciated. I am amazed how confused this stuff is making me![]()
Code:#include <iostream> using namespace std; char isVowel(char ch); int main() { char letter; cout << "Please enter a letter from the alphabet: "; cin >> letter; cout << "the letter you have entered is: "<<isVowel(letter)<<""<<endl; return 0; } char isVowel(char ch) { if (ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch== 'U'|| ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch== 'u') cout << "a Vowel" <<endl; else cout << "not a vowel" <<endl; return 1; }



LinkBack URL
About LinkBacks







zzZZzZ