(b) The galvanometer shows zero deflection $ie$, current through XY is zero.
As a result potential drop across R is 2V, circuit can be redrawn as
$I = \frac{12}{500 + R}$
Voltage across R, $V = IR$
$\Longrightarrow \ \ 2 = \frac{12}{500 + R} \times R$
$\Longrightarrow 1000 + 2R = 12R$
$\Longrightarrow R = 100\Omega$