The prototype for getchar is:
int getchar (void);
It returns an int because it needs to return EOF which is not a character.
Expanding on that, the function needs to be able to return any valid character, as well as being able to return a special "character" indicating that you're reached the end of file (or an error has occurred).
Since a char data type can only hold one of the characters, there would be no way to indicate this end of file if all the function returned was a char. That's because, if you selected one of those char values to represent end of file, you would not be able to tell the difference between the end of file and the actual character.
For example, let's choose 'A' to indicate end of file. When you actually get back an 'A' from getchar(), how will you know whether you've reached the end of file or whether the user actually entered 'A'?
To get around this, many functions that give you back a char will actually give you an int and use one of the integer values which don't have an actual char equivalent (such as -1).
In that case (assuming an 8-bit char), you would get back either a -1 if you've reached the end of the file or a value from 0 through 255 inclusive representing the character entered.
And you need to get yourself both a more modern book and a more modern compiler:
#include <stdio.h>
int main (void) {
int ch = getchar();
if (ch != EOF)
printf("You typed: %c\n", ch);
return 0;
}
Why anyone is still using Borland is this day and age (where gcc is both just as cheap and much better) is beyond me.