1#include <stdio.h>
2#include <ctype.h>
3
4int main()
5{
6 char c;
7 c='0';
8 printf("Result when numeric character is passed: %d", isdigit(c));
9
10 c='+';
11 printf("\nResult when non-numeric character is passed: %d", isdigit(c));
12
13 return 0;
14}
15
1#include <stdio.h>
2#include <ctype.h>
3
4int main()
5{
6 char c;
7
8 printf("Enter a character: ");
9 scanf("%c",&c);
10
11 if (isdigit(c) == 0)
12 printf("%c is not a digit.",c);
13 else
14 printf("%c is a digit.",c);
15 return 0;
16}
17