My academic curiosity:
1. By int tempC, I have decalred a 16-bit (2-byte) storage area/variable.
2. ((val * Vref) / 1024.0) * 100.0 will be evaluated to 32-bit (8-byte) binarya32 formatted floating point number having integer part and fractional part.
3. Then should I not impose casting (the int) on Step-2 to get the 16-bit integer part and assign it to variable tempC of Step-1?