Given, mass m=40g=`40 xx 10^(-3)`kg = 0.04kg

Temperature `T_(1)= -20^(@)C` and `T_(2)=20^(@)C`

Latent heat of ice `L_(ice) = 0.366 xx 10^(6)` J/kg

Specific heat of water `c_(w)` = u4200 J/kg-K

Heat required to conveert the ice into water at `0^(@)`C.

`mL_(ice)` = `0.04 xx 0.336 xx 10^(6)`=13440 J

Heat required to heat water from `0^(@)`C To `10^(@)`C

`=mc_(w)T_(2)` = `0.04 xx 4200 xx 20`=3360 J

Total heat required = 1680 + 13440 +3360 = 18480 J

Note: While doing numericals, keep in mind whenever there is a change in temperature, use Q = mc`DeltaT` or Q = `nCDeltaT`. If there is a change in state, use Q = mL