The current $I(t)$ in the resistor as the capacitor charges is given by:
$I(t) = \frac{V}{R} e^{-t/RC}$
Substitute the given values: $V = 10\,\text{V}$, $R = 20 \times 10^3\,\Omega$, $C = 500 \times 10^{-6}\,\text{F}$, and $t = 5\,\text{s}$:
$I(5) = \frac{10}{20 \times 10^3} \cdot e^{-5 / \left((20 \times 10^3)(500 \times 10^{-6})\right)}$
Calculate the time constant $RC$:
$RC = (20 \times 10^3)(500 \times 10^{-6}) = 10$
So:
$I(5) = \frac{10}{20000} \cdot e^{-5/10} = \frac{1}{2000} \cdot e^{-1/2}$
Therefore:
$I(5) = \frac{1}{\sqrt{e}}\,\text{mA}$
Thus, the current in the resistor after 5 seconds is $\frac{1}{\sqrt{e}}$ mA.