When I run this program:
I expect the output to be 'The value from isdigit: 0' for any non digit, and 'The value of isdigit: 1' for any digit. When it is a non digit entry I get 0 as I expected, but for a digit entry, I get 2048. Why is this so?Code:#include <stdio.h>
#include <ctype.h>
int main(void)
{
int c = 0;
printf("Enter a digit between 0 - 9\n");
fflush(stdout);
c = getchar();
printf("The value from isdigit: %d\n", isdigit(c));
return 0;
}
