In this example, you will learn to check a given character is alphabet or not.
In C language, every character has a unique ASCII value. The ASCII value of the uppercase alphabet lies between 65 and 90, the lowercase alphabet lies between 97 and 122.
The character input is taken from the user and compared with lower and uppercase of A and Z. In the comparison if the character lies between the range of either lower or uppercase of A and Z, then the character is an alphabet.
We can also check the character is an alphabet or not by using the predefined function isalpha() defined under ctype.h library.
C Program to Check Alphabet
C Program to Check Alphabet using isalpha() function
Enter a character: A A is an alphabet.