A transformer works on the principle that energy can be transferred by magnetic induction from one set of coils to…