In each case an acid reacts with a metal to give a salt and hydrogen gas. The salt of sulphuric acid is a sulphate and the salt of hydrochloric acid is a chloride.
(a) Word equation: zinc + sulphuric acid → zinc sulphate + hydrogen
Zn(s)+H2SO4(aq)→ZnSO4(aq)+H2(g)
(b) Word equation: magnesium + hydrochloric acid → magnesium chloride + hydrogen
Mg(s)+2HCl(aq)→MgCl2(aq)+H2(g)
Two HCl are needed because magnesium chloride contains two chlorine atoms.
(c) Word equation: aluminium + sulphuric acid → aluminium sulphate + hydrogen
2Al(s)+3H2SO4(aq)→Al2(SO4)3(aq)+3H2(g)
Check: 2 Al, 6 H, 3 S and 12 O on each side.
(d) Word equation: iron + hydrochloric acid → iron(II) chloride (ferrous chloride) + hydrogen
Fe(s)+2HCl(aq)→FeCl2(aq)+H2(g)
In every case the hydrogen can be confirmed by bringing a burning candle or splint near the gas: it burns with a pop sound.

The four things an acid reacts with. Every one of them gives a salt; what comes with the salt is the clue.