Dcan be in equilibrium in two orientations, one stable while the other is unstable.
d
When a current loop is placed in a magnetic field it experiences a torque. It is given by
$\vec{\tau}=\vec{M} \times \vec{B}$
where, $\vec{M}$ is the magnetic moment of the loop and $\vec{B}$ is the magnetic field.
or $\quad \tau=M B \sin \theta$ where $\theta$ is angle between $M$ and $B$ When $\vec{M}$ and $\vec{B}$ are parallel (i.e. $\theta=0^{\circ}$ ) the equilibrium is stable and when they are antiparallel (i.e. $\theta=\pi$ ) the equilibrium is unstable.