-
test
Code:
#include <iostream>
using namespace std;
char isVowel(char ch);
int main()
{
char ch;
cout << "Please enter a letter from the alphabet: ";
cin >> ch;
cout<<"the letter you have entered is: isVowel(ch)";
return 0;
}
char isVowel(char x)
{
if (char ch = 'a')
cout << "A Vowel" <<endl;
else
cout << "Not a vowel" <<endl;
return 1;
}
-
a) This belongs on the C++ board.
b) You have not asked a question or given any reason for posting your code.
c) if(char ch = 'a') is always true because you can always do that assignment
-- use if(x == 'a') and look into the or ( || ) operator
-
Nice use of code tags, though. :cool:
-
not to mention, there's no error trapping.
-