Rather than trying to work out that it's not a character, work out that it is a digit and discard the rest using the isdigit function from ctype like below.
#include <ctype.h>
...
if (isdigit(num)) {
printf("You entered %d\n", num);
}
But this only works on single characters which is quite useless when you read in strings. So instead you could instead use the function sscanf. Like this.
int num;
if (sscanf(numstr, "%d", &num)){
printf("You entered %d\n", num);
} else {
printf("Invalid input '%s'\n", numstr);
}
Another option is to use the atoi function. But as I recall it doesn't handle errors and I find quite inferior to sscanf.