Question:

Which of the following statements are true with respect to append \textless a\textgreater\ mode?
A. The user can read the file in \textless a\textgreater\ mode.
B. If the file is opened in \textless a\textgreater\ mode and the file doesn’t exist, then it will create a new file.
C. The user can write at the end of existing file when file is opened in \textless a\textgreater\ mode.
D. \textless a\textgreater\ mode is the default mode.
E. If the file is opened in \textless a\textgreater\ mode, the file offset position returned in the End of the file.
Choose the correct answer from the options given below:

Show Hint

Append (`a`) mode = always writes at the end. Read not allowed unless using `a+`.
Updated On: Apr 28, 2025
  • A, B and C only
  • A, B, C and E only
  • A, B and D only
  • B, C and E only
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

  • A is incorrect: <a> mode is for writing; to read, <a+> is needed.
  • B is correct: <a> will create the file if it doesn’t exist.
  • C is correct: it writes only at the end.
  • D is incorrect: 'r' is the default mode.
  • E is correct: in append mode, writes occur at the file’s end.
Was this answer helpful?
0
0