All mock tests are FREE till 31 December — register to save your progress
Unit 3 · Programming Languages and Computer Graphics Paper 2 CS · June 2024 (Re-Exam)

Arrange the following steps of file handling in C in the correct order :

(A) Close the file

(B) Read from or write to the file

(C) Open the file

(D) Check for error

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. (C), (D), (B), (A)

Explanation

Open the file (fopen), check it opened without error (NULL check), read or write, then close it (fclose).

More Programming Languages and Computer Graphics questions