Answer to Question #180276 in C++ for Puja

Question #180276

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


1
Expert's answer
2021-04-11T02:33:52-0400
#include<iostream> //for input and output  

using namespace std;  

int isVowel(char ch){

 if ((ch == 'A') || (ch == 'E')|| (ch == 'I')|| (ch == 'O')|| (ch == 'U')|| (ch == 'a')|| (ch == 'e')||  

           (ch == 'i')|| (ch == 'o')|| (ch == 'u')) {

   

               return true;

           }  

           else {

            return false;

  }

}

int main()  

{  

char character;

cout<<"Enter character : ";

cin >> character;

cout<<character<< " is a vowel:"<<isVowel(character);

  return 0;

}  

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS