Given 8kg body is in rest, means that body is stationary / non-moving. Consider it, you can solve as shown below,
M1=4kg
U1=10m/s
M2=8kg
U2=0m/s
V=V1+V2m/s
According to conservation of momentum,
M1U1+M2U2=M1V+M2V
M1U1+M2U2=V(M1+M2)
(4*10)+(8*0)=V(4+8)
40+0 = V(12)
40/12=V
3.33m/s=V
ie; The velocity of 8kg body is V=3.33m/s