(b)
Let the oxidation number of carbonyl carbon in methanal (HCHO) and methanoic acid (HCOOH) is $x$ and $y$ is respectively.
In HCHO,
2$( + 1) + x + ( - 2) = 0$
2$+ x - 2 = 0$
$x = 0$
In HCOOH,
$2( + 1) + y + 2( - 2) = 0$
2$+ y - 4 = 0$
$y = 2$