Why is it considered good practice to close files explicitly even if the…

PYQ Coal India Management Trainee CBT 2026

Why is it considered good practice to close files explicitly even if the programming language runtime may close them at program termination?

  1. A.

    To guarantee file permissions are reset

  2. B.

    To protect the file from accidental deletion

  3. C.

    To ensure the file remains hidden and cannot be reopened by others

  4. D.

    To release resources promptly and avoid resource leaks during execution

Attempted by 71 students.

Sign up free to check your answer

Sign up free

Explore the full course: Coal India Management Trainee

Loading lesson…