C examples for Data Type:char
isdigit() function takes one parameter.
isdigit(x)
If the parameter x is a digit, the isdigit() function will return a true value; otherwise, a 0 or false value.
#include <stdio.h> #include <ctype.h> int main()/* ww w .j a va 2 s . c o m*/ { char cResponse = '\0'; printf("\nPlease enter a letter: "); scanf("%c", &cResponse); if ( isdigit(cResponse) == 0 ) printf("\nThank you\n"); else printf("\nYou did not enter a letter\n"); }