Copyright © 2014 by tutorialspoint
#include <stdio.h> int isdigit(int c);
The function returns nonzero if c is any of:
0 1 2 3 4 5 6 7 8 9
The function returns nonzero if c is a digit otherwise this will return zero which will be equivalent to false.
#include <stdio.h> int main() { if( isdigit( '9' ) ) { printf( "Character 9 is a digit\n" ); } if( isdigit( 'A' ) ) { printf( "Character A is digit\n" ); } return 0; }
It will proiduce following result:
Character 9 is a digit
Advertisements