we know that 40 is the 100%, so what would 12 be off of it in percentage?
[tex]\bf \begin{array}{ccll} amount&\%\\ \cline{1-2} 40&100\\ 12&x \end{array}\implies \cfrac{40}{12}=\cfrac{100}{x}\implies \cfrac{10}{3}=\cfrac{100}{x} \\\\\\ 10x=300\implies x=\cfrac{300}{10}\implies x=30[/tex]