12.71 g NaHCO3 / (84.007 g/mol NaHCO3) = 0.1513 mol NaHCO3
3 g HCl / (36.46 g/mol HCl) = 0.0823 mol HCl
The balanced reaction is: NaHCO3 + HCl --> NaCl + H2O + CO2, so this is a 1:1 mole ratio between reactants, and HCl is the limiting reactant. Theoretically, the yield should have been 0.0823 mol of each product (NaCl, CO2, H2O), which is equivalent to:
(0.0823 mol NaCl)(56.44 g/mol NaCl) = 4.81 g NaCl
(0.0823 mol CO2)(44.01 g/mol CO2) = 3.62 g CO2
(0.0823 mol H2O)(18.02 g/mol H2O) = 1.48 g H2O
Which totals to 9.91 g of product
Dividing the actual product of 7.17 by the theoretical value of 9.91 gives a percent yield of 72.35%.