Multiple choice technology web technology

Which of the following mode of fopen() function opens a file only for writing. If a file with that name does not exist, attempts to create anew file. If the file exist, place the file pointer at the end of the file after all other data?

  1. A

  2. W

  3. W+

  4. A+

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The 'a' (append) mode opens a file for writing only, places the pointer at the end, and creates the file if it doesn't exist. Option C (W+) would open for reading AND writing but would truncate the file. Options B (W) and D (A+) are incorrect for 'writing only' requirement.