Step 1: Work done in rotating a magnetic moment.
The work done \( W \) to rotate a magnetic moment \( M \) through an angle \( \theta \) in a magnetic field \( B \) is given by:
\[
W = -M B \cos \theta
\]
where \( \theta = 90^\circ \). Step 2: Calculate the work done.
When \( \theta = 90^\circ \), the work done is \( W = -M B \left( \cos 90^\circ \right) = \frac{1}{2} M B \). Thus, the correct answer is (2).