Question 77Asked in DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

Which function is used in C to open a file in binary mode for writing?

  1. Afopen("file.txt", "wb")
  2. Bfopen("file.txt", "bw")
  3. Cfopen("file.txt", "binary")
  4. Dfopen("file.txt", "b")
Show answerHide answer

Correct answer: (A) fopen("file.txt", "wb")

Explanation

The mode "wb" opens a file for writing in binary mode. The mode string is "w" followed by "b", not "bw" or "binary".

From DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5:00 PM)

This is question 77 of DSSSB TGT Computer Science PYQ (Technical), 13 Sep 2025, Shift 3 (5: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.