When an electric current passes through a wire, it behaves like a magnet. This is the magnetic effect of the electric current. If the electric current does not passes through, it loses its magnetic efffect. These coils of wire is called electromagnets.