Both colas have gas bubbles in them, potentially lowering their density below that of water. However, the non-diet drink also contains a lot of sugar (or corn syrup) dissolved in it, increasing the can’s overall density to above that of water, so it sinks.
Work Step by Step
The diet drink evidently has a different sweetener dissolved in it, so that the can’s overall density is less than water’s density. The can of diet soda floats.