Write a Program to Print Check Whether a Character is an Alphabet or Not

C++// C++ program to print whether a character is an alphabet // or not #include <cctype> #include <iostream> using namespace std; int main() { char ch; ch = 'a'; if (isalpha(ch)) { cout << ch << " is an alphabet." << endl; } else { cout << ch << " is not an alphabet." << endl; } return 0; }

Output

a is an alphabet.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *