Learning C
C Function References
C Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
C - isdigit function
Synopsis:
#include <stdio.h>
int isdigit(int c);
|
Description:
The function returns nonzero if c is any of:
Return Value
The function returns nonzero if c is a digit otherwise this will return zero which will be equivalent to false.
Example
#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:
|
|
|
|