What is the purpose of a capacitor

Answer: It maintains proper voltage in a circuit.
.Explanation:
Reservoir capacitors are used in power supplies where they smooth the output of a full or half wave rectifier. They can also be used in charge pump circuits as the energy storage element in the generation of higher voltages than the input voltage.