Answer
a) $\vec{\tau} = -NIAB \ \vec{a}_x$ and $U = 0$
b) $\vec{\tau} = \vec{0}$ and $U = -NIAB$
c) $\vec{\tau} = NIAB \ \vec{a}_x$ and $U = 0$
d) $\vec{\tau} = \vec{0}$ and $U = NIAB$
Work Step by Step
To calculate the torque, you need this formula :
$\vec{\tau} = \vec{\mu} \times \vec{B} = I_{tot} \vec{A} \times \vec{B} = NIA \ \hat{\vec{n}} \times \vec{B}$ where $\hat{\vec{n}}$ is the normal unit vector associated with surface $A$.
And for the potential energy :
$U = - \vec{\mu} \cdot \vec{B} = - NIA\ \hat{\vec{n}} \cdot \vec{B}$
In this situation, $\vec{B} = B\ \vec{a}_y$
a) $\hat{\vec{n}} = \vec{a}_z$ so $\vec{\tau} = -NIAB \ \vec{a}_x$ and $U = 0$
b) $\hat{\vec{n}} = \vec{a}_y$ so $\vec{\tau} = \vec{0}$ and $U = -NIAB$
c) $\hat{\vec{n}} = -\vec{a}_z$ so $\vec{\tau} = NIAB \ \vec{a}_x$ and $U = 0$
d) $\hat{\vec{n}} = \vec{a}_z$ so $\vec{\tau} = \vec{0}$ and $U = NIAB$