Iqbal treated a lustrous, divalent element M with sodium hydroxide

Iqbal treated a lustrous, divalent element M with sodium hydroxide. He observed the formation of bubbles in reaction mixture. He made the same observations when this element was treated with hydrochloric acid. Suggest how can he identify the produced gas. Write chemical equations for both the reactions.

Answer:

The element is a metal.
image
The produced gas can be identified by bringing a burning matchstick near the reaction vessel. The gas burns with a pop sound. This confirms that the gas is H2.