Answer
Option $\text{C}$.
$9$ cartons were used.
Work Step by Step
If we let $x$ be the number of cartons of eggs, and each carton contains $18$ eggs, then the equation needed to solve the problem is:
$$18x=162$$
Thus, the answer is Option $\text{C}$.
To solve the equation, divide both sides of the equation by $18$:
$$\begin{align*}
\frac{18x}{18}&=\frac{162}{18}\\
x&=9
\end{align*}$$
Therefore, $9$ cartons were used .