Most solids and liquids expand with rising temperature. Water, the most common and most important liquid on Earth, has a limitation on this expansion. Ice water that is at a temperature of 0oC or 32oF will contract when it is heated. This contraction continues until after an increase beyond 4oC or 39.2oF. Then water that continues to be heated will finally begin to expand like other liquids until it reaches a gaseous state. At 4oC water has its smallest volume and also its greatest density. Water that is below 0oC has a larger volume and a smaller density. Therefore the reason why ice floats in your cup of soda is because ice is less dense or weighs less than water. This is also the reason why your water pipes may burst in the winter if you are not careful - the water inside increases in volume and weight as it cools from 4 to 0oCelsius.
When water freezes it expands, as opposed to practically all other liquids. (For this reason ice is less dense than water and it fortunately forms on the TOP of ponds and lakes.) The expansion causes pressure to build up that could eventually burst the pipe. However, most bursts occur in home water pipes because, as the ice builds up in the direction of the pipe, the water pressure continues to build up downstream from the growing volume of ice as water in this section of the pipe is being compressed, that is between the ice and the faucet(s). (Water pressure is not expected to build up significantly upstream as there is much more water on this side.) This enormous build-up of pressure can eventually cause the strongest of pipes to burst. It is a good idea to leave a faucet dripping if the pipe leading to it is in danger of freezing. Not only does this significantly reduce the chance of the water freezing in the pipe, but it keeps the water pressure from building up to dangerous levels that can cause bursting.