Such rounding problems are common with floating point operations.
In your case you may just check for small numbers and assign zero before printing:
if (fabs(c) <= 1e-8)
c = 0.0;
You have this problem because you are using the '%g' format. Your formula is some kind of temperature conversion/calculation. There is no need to print more digits than the precision of your values. So you may change your format to something like '%.3f' depending on the range and accuracy of the input values. You may also use a fixed width: '%8.3f' will print aboslute values less than thousand with three digits after the decimal point.