The formula of a volume of a cone:
[tex]V=\dfrac{1}{3}\pi r^2H[/tex]
r - radius
H - height
We have a diameter d = 3in (d = 2r → r = d:2 → r = 3in : 2 = 1.5in)
and the volume 12in³.
Substitute:
[tex]\dfrac{1}{3}\pi(1.5)^2H=12\qquad\text{multiply both sides by 3}\\\\2.25\pi H=36\qquad\text{divide both sides by 2.25}\pi\\\\H=\dfrac{36}{2.25\pi}\\\\H=\dfrac{16}{\pi}\ in\\\\H=\dfrac{16}{3.14}\to H\approx5\ in.[/tex]