isdigit
Syntax:
#include <cctype> int isdigit( int ch );
The function isdigit() returns non-zero if its argument is a digit between 0 and 9. Otherwise, zero is returned.
char c; scanf( "%c", &c ); if( isdigit(c) ) printf( "You entered the digit %c\n", c );
Related topics: