Question 50Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

Which function is used to close a file in C?

  1. Aclose()
  2. Bfclose()
  3. Cflush()
  4. Dendfile()
Show answerHide answer

Correct answer: (B) fclose()

Explanation

fclose(fp) closes a file opened with fopen and flushes its buffers. close() is the low-level POSIX call on file descriptors, not the standard C file function.

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM)

This is question 50 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 2 (1:00 PM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.