#include <iostream>
int main() {
char ch;
std::cout << "Enter a character: ";
std::cin >> ch;
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
std::cout << ch << " is a vowel.";
else
std::cout << ch << " is a consonant.";
return 0;
}
Enter a character: G
G is a consonant.std::cout and std::cin objects from the iostream library. >> operator is used to input the user's character into the ch variable.vowel or a consonant. std::cout to output the message to the console.