Which mode of opening is required when REWRITE is used?

  1. INPUT

  2. OUTPUT

  3. I-O

  4. EXTEND

  5. All of the above

  6. None of the above


Correct Option: C

AI Explanation

To understand which mode of opening is required when the REWRITE statement is used, let's go through each option:

Option A) INPUT - This option is incorrect because the INPUT mode is used for reading data from a file, not for rewriting existing data.

Option B) OUTPUT - This option is incorrect because the OUTPUT mode is used for writing data to a file, not for rewriting existing data.

Option C) I-O - This option is correct because the I-O mode (Input-Output) is used when you want to both read and rewrite existing data in a file. The REWRITE statement is used specifically to rewrite existing records within a file.

Option D) EXTEND - This option is incorrect because the EXTEND mode is used to add new records to the end of a file, not for rewriting existing data.

Option E) All of the above - This option is incorrect because not all of the above options are required when using the REWRITE statement. Only the I-O mode is required.

Option F) None of the above - This option is incorrect because the correct answer is option C, I-O.

Therefore, the correct answer is option C, I-O. This option is correct because the I-O mode is required when using the REWRITE statement to rewrite existing records in a file.

Find more quizzes: