Write a c program to check a character is alphabet or not

28th Dec 2022, 1:22 PM
Alvaro Morte
Alvaro Morte - avatar
3 Answers
+ 5
Alvaro Morte , besides the suggestion given by Lisa we can also use: > the c library function *isalpha(...)*. > to check for letters and digits we can use *isalnum(...)*
29th Dec 2022, 7:45 AM
Lothar - avatar
+ 3
You can approach the task like this: * get input * use the ascii value of the character and an if-statement to check if the input is within the range of ascii characters example: https://www.programiz.com/c-programming/examples/alphabet
28th Dec 2022, 1:26 PM
Lisa - avatar
+ 3
Alvaro Morte , do you need to input and check just a single character, or do you need to check all characters of a string?
28th Dec 2022, 6:58 PM
Lothar - avatar