What creates the magnetic field in an electromagnet?

A electric current through a straight piece of metal

B magnetic fields around a straight wire

C electric current through a wire coil

D all of these