The stoichiometric equation of the reaction between magnesium and hydrogen chloride can be written as follows,
One mole magnesium can liberate one mole of hydrogen gas according to the following equation.
=0.1mole2.4gMg+2HCl→MgCl2+0.1moleH2
Volume of 1 mole H2 at =22.4L
∴0.1 mole H2 at STP will occupy =2.24L