Many reactions involve a solid and a gas, for example a metal reacting with acid to give hydrogen. To link the mass of the solid to the volume of the gas, you go through moles, using the balanced equation and the molar volume of 24 dm3 (24 000 cm3) at room temperature and pressure.
Solid to gas: (1) convert the mass to moles using moles = mass / Mr. (2) Use the ratio in the balanced equation to find the moles of gas. (3) Multiply the moles of gas by 24 to get the volume in dm3, or by 24 000 for cm3. Example: CaCO3 + 2HCl → CaCl2 + H2O + CO2. 5.0 g of CaCO3 (Mr 100) is 0.050 mol. The ratio is 1 : 1, so 0.050 mol of CO2 forms, which is 0.050 x 24 = 1.2 dm3.
Gas to solid: do the steps in reverse. Example: Zn + 2HCl → ZnCl2 + H2. If 480 cm3 of hydrogen is collected, the moles are 480 / 24 000 = 0.020 mol. The ratio is 1 : 1, so 0.020 mol of zinc reacted, and the mass is 0.020 x 65 = 1.3 g (Ar of Zn = 65). Always check the ratio, because it is not always 1 : 1.