Help modifying DS18B20 sample code to activate a relay

You need to change the return type of the print routine from void to float and add return tempC; at the bottom of the function.

When you do that, and I agree that it is necessary, give serious thought to renaming the function. printTemperature() should not return a value, at least not the temperature that it printed.