Don’t forget to cast (a.k.a. 1 / 5 = 0)

You would think that people would remember this. C keeps things as an integer unless you tell it otherwise. This means that unless you tell the computer otherwise, it will keep blithely working on integers. so to get a proper answer cast one of the values to a float, and the entire operation gets done as a floating point operation.
Simple rules for simple languages.