Which of the following denotes file modes that can be used in C program?

  1. "r"

  2. "w"

  3. "a"

  4. all the above


Correct Option: D
Explanation:

To solve this question, the user needs to know about file modes in C programming.

In C programming, the file modes are used to specify the type of access that is required to open the file. Each mode represents a different type of operation that can be performed on the file. The three most commonly used file modes are "r" for reading, "w" for writing, and "a" for appending.

Option D is correct because all of the given options denote file modes that can be used in a C program.

Option A ( "r" ) is used to open a file for reading purposes.

Option B ( "w" ) is used to open a file for writing purposes. If the file already exists, the contents of the file are overwritten. If the file does not exist, a new file is created.

Option C ( "a" ) is used to open a file for appending purposes. If the file already exists, new data is written to the end of the file. If the file does not exist, a new file is created.

Therefore, the answer is: D

Find more quizzes: