Activity: Teacher has wound a long insulated piece of wire around an iron nail in the form of a coil. Free ends of the wire are connected to a cell through a switch as shown in the Figure.
The current is switched on and some pins are placed near the ends of the nail.
(i) Why does the nail attract the pins?