Which file opening mode ensures that output is written at the end of a file?

Options

  • A. ios::in
  • B. ios::trunc
  • C. ios::app
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. ios::app

Detailed Explanation

Correct Answer: Option C

Explanation:
ios::app opens a file in append mode. Every write operation takes place at the end of the file, preserving the existing contents.