What is the return type of getchar()?
(A) int
(B) char
(C) unsigned char
(D) float
Answer: (A)
Explanation: The return type of getchar() is int to accommodate EOF which indicates failure:
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- C | Input and Output | Question 13
- C | Input and Output | Question 2
- C | Input and Output | Question 3
- C | Input and Output | Question 4
- C | Input and Output | Question 5
- C | Input and Output | Question 6
- C | Input and Output | Question 13
- C | Input and Output | Question 8
- C | Input and Output | Question 9
- C | Input and Output | Question 13
- C | Input and Output | Question 11
- C | Input and Output | Question 12
- Basic Input and Output in C
- Input-output system calls in C | Create, Open, Close, Read, Write
- Code valid in both C and C++ but produce different output
- Lex program to take input from file and remove multiple spaces, lines and tabs
- Output of the program | Dereference, Reference, Dereference, Reference....
- How to change the output of printf() in main() ?
- Output of C Program | Set 29
- Output of C programs | Set 30 (Switch Case)

