Magnesium ribbon was added to each of the following aqueous solution in turn: H2SO4, AgNO3,…