Program # 03: Program to Check Whether a character is Vowel or Consonant. #include using namespace std; int main() { char c; int islowercaseVowel, isUppercaseVowel; cout << "Enter an alphabet: "; cin >> c; // evaluates to 1 (true) if c is a lowercase vowel isLowercaseVowel = (c == 'a' || c == 'e' || c == '' || c == 'o' || c == 'u'); // evaluates to 1 (true) if c is an uppercase vowel isUppercaseVowel = (c == 'A' || c == 'E' || c == 'l' || c == '0' || c == 'U'); // show error message if c is not an alphabet if (lisalpha(c)) printf("Error! Non-alphabetic character."); else if (isLowercaseVowel || isUppercaseVowel) cout <

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question
100%
Remove some minor error from the given program.Please.
Program # 03: Program to Check Whether a character is Vowel or Consonant.
#include <iostream>
using namespace std;
int main() {
char c;
int isLowercaseVowel, isUppercaseVowel;
cout < "Enter an alphabet: ";
cin >> c;
// evaluates to 1 (true) if c is a lowercase vowel
isLowercaseVowel = (c == 'a' || c == 'e' ||c == i' || c == 'o' || c == 'u');
// evaluates to 1 (true) if c is an uppercase vowel
isUppercaseVowel = (c == 'A' || c == 'E' || == '" || c == 'O' ||c == 'U');
// show error message if c is not an alphabet
if (lisalpha(c))
printf("Error! Non-alphabetic character.");
else if (isLowercaseVowel || isUppercaseVowel)
cout <<c<«< "is a vowel.";
else
cout <« c« " is a consonant.";
return 0;
Transcribed Image Text:Program # 03: Program to Check Whether a character is Vowel or Consonant. #include <iostream> using namespace std; int main() { char c; int isLowercaseVowel, isUppercaseVowel; cout < "Enter an alphabet: "; cin >> c; // evaluates to 1 (true) if c is a lowercase vowel isLowercaseVowel = (c == 'a' || c == 'e' ||c == i' || c == 'o' || c == 'u'); // evaluates to 1 (true) if c is an uppercase vowel isUppercaseVowel = (c == 'A' || c == 'E' || == '" || c == 'O' ||c == 'U'); // show error message if c is not an alphabet if (lisalpha(c)) printf("Error! Non-alphabetic character."); else if (isLowercaseVowel || isUppercaseVowel) cout <<c<«< "is a vowel."; else cout <« c« " is a consonant."; return 0;
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr