The maximum amount of Magnesium chloride that can be produced is 26.11 grams
calculation
find the moles of each reactant
that is
moles = mass/molar mass
moles of mg = 20 g/ 24.3 g/mol =0.617 moles
moles of HCl =20/36.5 =0.548 moles
write a balanced equation for reaction
Mg +2HCl =MgCl2 +H2
by use of mole ratio between Mg to MgCl2 which is 1:1 therefore the moles of MgCl2 = 0.617 moles
by use of mole ratio between HCl to MgCl2 which is 2:1 the moles of MgCl2 is therefore = 0.548 x1/2=0.274 moles
HCl is the limiting reagent therefore we use the moles MgCl2 derived from HCl, that is 0.274 moles
maximum mass is therefore = moles x molar mass
the molar mass of MgCl2 = 24.3 +(35.5 x2) =95.3 g/mol
maximum mass is therefore = 0.274 x95.3 = 26.11 grams