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

In C, which of the following file opening modes allow both reading and appending data in a

In C, which of the following file opening modes allow both reading and appending data in a file?
  1. A"w+"
  2. B"a"
  3. C"r"
  4. D"a+"
Show answerHide answer

Correct answer: (D) "a+"

Explanation

Mode "a+" opens a file for reading and appending: you can read anywhere, and every write goes to the end. "a" only appends, and "w+" truncates the file first.

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

This is question 41 of DSSSB TGT Computer Science PYQ (Technical), 12 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.