Question: What is the purpose of a destructor?

  1. It allows the programmer to write the necessary code to free the resources acquired by the object prior to deleting the object itself.
  2. It deletes an object. One example of a destructor is the `delete()` function.
  3. It terminates a program. This may be achieved as a regular function call or as an exception.
  4. There are no destructors in C++.

Answer: The correct answer of the above question is Option A:It allows the programmer to write the necessary code to free the resources acquired by the object prior to deleting the object itself.