For the first exercise, note that if the decimal expansion of n = $a_ma_{m-1}\ldots a_1a_0$, then
$$
n = \sum_{k=0}^ma_k10^k
$$
Also recall that 1 $\equiv 10^k$(mod 3) for every k.
So
$$n (mod 3) \equiv \sum_{k=0}^ma_k10^k(mod 3) \equiv\sum_{k=0}^ma_k(mod 3).\checkmark
$$
Similarly for the second exercise note that 0 $\equiv 10^k$ for k $\ge$2.
So
$$n(mod 4) \equiv \sum_{k=0}^ma_k10^k(mod 4)\equiv\sum_{k=0}^1a_k10^k(mod 4) \equiv a_1a_0(mod4). \checkmark
$$
For the first exercise, note that if the decimal expansion of n = $a_ma_{m-1}\ldots a_1a_0$, then $$ n = \sum_{k=0}^ma_k10^k $$ Also recall that 1 $\equiv 10^k$(mod 3) for every k. So $$n (mod 3) \equiv \sum_{k=0}^ma_k10^k(mod 3) \equiv\sum_{k=0}^ma_k(mod 3).\checkmark $$
Similarly for the second exercise note that 0 $\equiv 10^k$ for k $\ge$2. So $$n(mod 4) \equiv \sum_{k=0}^ma_k10^k(mod 4)\equiv\sum_{k=0}^1a_k10^k(mod 4) \equiv a_1a_0(mod4). \checkmark $$