(b) The work done in charging the capacitor $(C)$ is stored as potential energy $(U)$ in the vicinity of capacitor, given by.
$U = \frac{1}{2}CV^{2}$
This produces the heat when its plates are joint through a resistance.
Given, $C = 4\mu F = 4 \times 10^{- 6}F,\ V = 400$volt
$\therefore\ \ U = \frac{1}{2} \times 4 \times 10^{- 6} \times (400)^{2}$
$\ \ \ \ \ \ U = 0.32\ J$