A magnetic needle is kept in a non-uniform magnetic field. It experiences:
Show Hint
In a non-uniform magnetic field, the imbalance in forces on the poles of a magnetic dipole generates both a net force and a torque. The torque aligns the dipole with the field lines.