${x}+6 \times(-1)=-4$
${x}=+2$
${Co}^{2+}:[{Ar}] 3 {~d}^{7}$
and ${CN}^{-}$is a strong field ligand which can pair electron of central atom.
It has one unpaired electron ( $n$ ) in $4d-$subshell.So spin only magnetic moment $(\mu)=\sqrt{n(n+2)}\, B . M$
where ${n}=$ number of unpaired electrons.
$\mu=\sqrt{3} \,{~B} . {M} \quad \mu=1.73\, {BM}$
[પ.ક્ર.: $Cr= 24,\,Mn= 25, \,Fe= 26, \,Co= 27$]