Which of these values is returned by read() method is end of file (EOF) is encountered?
A. 0
B. 1
C. -1
D. Null
Answer:A
Which of these values is returned by read() method is end of file (EOF) is encountered?
A. 0 B. 1 C. -1 D. Null
Explanation: Each time read() is called, it reads a single byte from the file and returns the byte as an integer value. read() returns -1 when the end of the file is encountered.