how need to white code what it show for me min temperature same as max temp?
minTempC = maxTempC;
But that hardly seems like that you want to do.
You might try actually assigning values to minTempC and maxTempC when you declare them. Try setting both to 149.0, to see what happens. Then, try setting both to -238.4 to see what happens. I'm sure that sooner or later, you'll stub your toe on a clue.
PaulS:
You might try actually assigning values to minTempC and maxTempC when you declare them. Try setting both to 149.0, to see what happens. Then, try setting both to -238.4 to see what happens. I'm sure that sooner or later, you'll stub your toe on a clue.
It only worked because your values were all greater than 0, which is the default value when you do not supply one.
You could have defined a boolean, firstReadingTaken, initially set to false. Then, when the first reading was taken, you could have set minTempC and maxTempC to that reading, and set firstReadingTaken to true. When firstReadingTaken is false, assign the value, as mentioned. When it is true, compare it to minTempC and maxTempC as you are doing.
PaulS:
You could have defined a boolean, firstReadingTaken, initially set to false. Then, when the first reading was taken, you could have set minTempC and maxTempC to that reading, and set firstReadingTaken to true. When firstReadingTaken is false, assign the value, as mentioned. When it is true, compare it to minTempC and maxTempC as you are doing.