(A) Let the speed of the $1^{st}$ car be $u \ km/h$ and the $2^{nd}$ car be $v \ km/h$.
When the cars travel in the same direction,their relative speed is $(u - v) \ km/h$. Since they meet in $5 \ hours$ covering a distance of $100 \ km$,we have:
$5(u - v) = 100 \Rightarrow u - v = 20 \quad \dots(1)$
When the cars travel towards each other,their relative speed is $(u + v) \ km/h$. Since they meet in $1 \ hour$ covering a distance of $100 \ km$,we have:
$1(u + v) = 100 \Rightarrow u + v = 100 \quad \dots(2)$
Adding equations $(1)$ and $(2)$:
$(u - v) + (u + v) = 20 + 100$
$2u = 120 \Rightarrow u = 60 \ km/h$
Substituting $u = 60$ in equation $(2)$:
$60 + v = 100 \Rightarrow v = 40 \ km/h$
Thus,the speed of the first car is $60 \ km/h$ and the speed of the second car is $40 \ km/h$.