(d) Let final temperature be $\theta$
Now heat taken by ice=$m_{1}L + m_{1}c_{1}\theta_{1}$
$= 5 \times 80 + 5 \times 1(\theta - 0)$
=$400 + 5\theta$ …(i)
Heat given by water at $40℃$
$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ = m_{2}C_{2}\theta_{2} = 20 \times 1 \times (40{^\circ} - \theta)$ …(ii)
Heat given=Heat taken
800$-$20$\ \theta$=400$+$5$\ \theta$
or 25$\ \theta$ = 400,
or $\ \ \theta = \frac{400}{25} = 16℃$