Default return-type of getchar() - int - C programming
Q. What is the default return-type of getchar()? (C programming)- Published on 26 Jun 15a. char
b. int
c. char *
d. Reading character doesn't require a return-type
ANSWER: int
The getchar needs to remove some abnormal state. Say for example read error or end of file (EOF = -1). Here the returned value is not 0-255 so It is not possible to represent such cases with char type.