As noted, EOF will not be true until ^D is entered. Terminate on that, but also check for the newline character. Check this older Question for some good background on this here:
getchar() != EOF
Here is the program written using ints and checking for newline or EOF
// Customize AT_END Macro to return true based on some condition
#define AT_END(ch) (((ch)=='\n') || ((ch)==EOF))
int main(void)
{
int inpChar = getchar();
int nc = 0;
while (!AT_END(inpChar)) {
nc++;
inpChar = getchar();
};
printf("Number of chars=%d\n", nc);
}