A type of magnet whose magnetic field is produced by the flow of electric current. The magnetic field…