Temeratures control with outputs

I dont understand what you mean. I need 3 DS18B20 sensors to control three outputs tank1,2 and 3 and leds to.

Yes, but each time you call printTemperature() for a specific address, you do not need to read all three sensors. If you are going to read all three each time, then calling the function three times does not make sense.

The function should return a value that the caller stores. There should be no references to global variables in the function.