Magnesium does not react with cold water. It reacts with hot water to form magnesium hydroxide and hydrogen. It also starts floating due to the bubbles of hydrogen gas sticking to its surface.
Some of the learners also asked: What happens when some metals are exposed to moisture, air, acids ?