The density of water is maximum at :
4°C
Liquids generally expand on heating, but water is an exception. Ice has a 3-D cage structure with vacant spaces in it. When it is heated from 0 °C, the water molecules start coming closer and filling these gaps. This contraction in volume causes the density to increase.
This contraction continues till 4 °C where water achieves its maximum density.
Above 4 °C, water molecules move apart causing expansion. And this expansion continues with further increase in temperature. Thereby, reducing the density.
This property of water is called anomalous expansion of water.
This is the reason why ice is less dense than water, and hence floats on it.