Function name : isalnum
Header file : <ctype.h>
Function prototype : int isalnum(int ch);
Function : Determine whether a character is a letter or number
Parameters : int ch character to be checked
Return value : Returns 0 if ch is not a letter or number, returns non-0 if ch is a letter or number
Program example : Determine whether the entered characters are letters or numbers
#include<ctype.h>#include<stdio.h>intmain(){charch;printf(inputacharacter:);scanf(%c,&ch);if(isalnum(ch)){printf(%cisalnum.,ch) ;}else{printf(%cisnotalnum.,ch);}putchar('n');return0;}
Running results:
inputacharacter:ffisalnum.