Answer to Question #332922 in C++ for ahmi

Question #332922

Design a C++ program that takes character input from user and checks whether that letter is vowel alphabet or not using if...else statement


1
Expert's answer
2022-04-24T07:03:29-0400


#include <iostream>
#include <string.h>
using namespace std;
int main() {
  //check vowels letter
  char ch;
  cout<<"Please enter a character: ";
  cin>>ch;
  bool isVowel=ch=='a'||ch=='A'||ch=='e'||ch=='E'||ch=='i'||ch=='I'
    		||ch=='o'||ch=='O'||ch=='u'||ch=='U';
  char ans[2][50];
  strcpy(ans[1],"Yes Vowel:");
  strcpy(ans[0],"No It\'s doesnot vowel letter");
  cout<<ans[isVowel]<<endl;
  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