Need help with my code basic

I would recommend:

// Temperature is volts * 100
const float Vref = 5.0;
int tempC = ((val * Vref) / 1024.0) * 100.0;
Serial.print(tempC);