isdigit Function

  • It test the given character, whether it is a digit (0 to 9).
  • It returns nonzero if ch is a digit or zero is returned .

  • Syntax :
    int isdigit(int ch);

    Example

    
    #include <ctype.h>
    
    #include <stdio.h>
    
      void main() {
    
    	char ch='1';
    
    	if (isdigit(ch))
    
    	   printf("%c is a digit\n", ch);
    
    }
    
    

    Output