Answer and explanation:
We know that magnesium and hydrochloric acid are to react with each other so the chemical equation for this reaction will be:

Here in this reaction, the mole ratio of the reactants used is 1:1 that means we need equal amounts of magnesium as well as hydrochloric acid to have a complete reaction.
Therefore, the mass would be same since according to the law of conservation of mass, energy can neither be created nor destroyed but can only be changed.