(a) Initial K.E. of block when bullet strikes to it
$= \frac{1}{2}(m + M)V^{2}$
Due to this K.E. block will rise to a height $h$
Its potential energy $= (m + M)gh$
By the law of conservation of energy
$\frac{1}{2}(m + M)V^{2} = (m + M)gh$ $\therefore V = \sqrt{2gh}$