\(Mg+2HCl\rightarrow MgCl_2+H_2\\ n_{H_2}=\dfrac{12,395}{24,79}=0,5\left(mol\right)\\ n_{HCl}=2.0,5=1\left(mol\right)\\ n_{Mg}=n_{MgCl_2}=n_{H_2}=0,5\left(mol\right)\\ a,m=m_{Mg}=0,5.24=12\left(g\right)\\ b,C\%_{ddMgCl_2}=\dfrac{95.0,5}{100+12-0,5.1}.100\%\approx42,793\%\)