$\begin{aligned}
& \mathrm{M} \mid \mathrm{M}^{+2} | \mathrm{X} / \mathrm{X}^{2-} \
& \mathrm{E}{\mathrm{cell}}^{\mathrm{o}}=\mathrm{E}{\mathrm{M} / \mathrm{M}^{+2}}^{\mathrm{o}}+\mathrm{E}_{\mathrm{X} / \mathrm{X}^{-2}}^{\mathrm{o}} \
& =-0.46+0.34=-0.12 \mathrm{~V}
\end{aligned}$
As Ecell o is negative so anode becomes cathode and cathode become anode. Spontaneous reaction will be M+2+X2−⟶M+X