Mass of the bullet is given as $m_{1}=0.012 \mathrm{~kg}$
Initial speed of the bullet is given as $u_{1}=70 \mathrm{~m} / \mathrm{s}$
Mass of the wooden block is given as $m_{2}=0.4 \mathrm{~kg}$
Initial speed of the wooden block is given as $\mathrm{u}_{2}=0$
Final speed of the system of the bullet and the block will be $\mathrm{v} \space \mathrm{m} / \mathrm{s}$
On applying the law of conservation of momentum, we have,
$m_{1} u_{1}+m_{2} u_{2}=\left(m_{1}+m_{2}\right) v$
$(0.012 \times 70)+(0.4 \times 0)=(0.012+0.4) \mathrm{v}$
$\mathrm{v}=0.84 / 0.412$
$=2.04 \mathrm{~m} / \mathrm{s}$
Let the height to which the block rises be $h$
On applying the law of conservation of energy to this system, we get,
Potential energy of the combination $=$ Kinetic energy of the combination
$\left(m_{1}+m_{2}\right) g h=(1 / 2)\left(m_{1}+m_{2}\right) v^{2}$
$\mathrm{h}=\mathrm{v}^{2} / 2 \mathrm{~g}$
$=(2.04)^{2} / 2 \times 9.8$
$=0.212 \mathrm{~m}$
The heat produced $=$ Initial kinetic energy of the bullet $-$ final kinetic energy of the combination
$=(1 / 2) m_{1} u_{1}^{2}-(1 / 2)\left(m_{1}+m_{2}\right) v^{2}$
$=(1 / 2) \times 0.012 \times(70)^{2}-(1 / 2) \times(0.012+0.4) \times(2.04)^{2}$
$=29.4-0.857=28.54 \mathrm{~J}$