Write a value-returning function


Question:

User Defined Functions

Write a value-returning function, isVowel, that returns the value true if a given character is a vowel and otherwise returns false.

This is what I have so far with no luck compiling the program. Any help would be greatly appreciated.

#include

using namespace std;

char isVowel();

int main()
{
char ch1;

cout << "Please enter a character to see if it is a vowel: ";
cin >> ch1;
cout << endl;

return 0;
}

char isVowel()
{
if (char ch1 = 'a'||'e'||'i'||'o'||'u')
return 'True';
else
{
return 'False';
}
}

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Write a value-returning function
Reference No:- TGS01937512

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)