When light rays travel obliquely from an optically denser medium (water, in this case) to an optically rarer medium (air, in this case), they bend away from the normal at the point of incidence. As a result, the coin appears raised. Therefore, when the jar is tilted suitably and observed at a suitable angle, the coin appears to be floating.