Salts can be obtained in the following ways:
(i) Acid reacts with base to give salt and water.
HCl + KOH → KCl + H2O
acid base salt
(ii) Metals react with acids to form salt and give hydrogen gas.
Mg + 2HCl → MgCl2 + H2
(iii) Metallic oxide reacts with acid to form salt.
CuO + 2HCl → CuCl2 + H2O