A capacitor is an electronic device that stores energy in form of electrical charges. Capacitors are one of the most important…