temperature in c programming

Solutions on MaxInterview for temperature in c programming by the best coders in the world

showing results for - "temperature in c programming"
Greta
13 Aug 2018
1    if (high[0] > high[1] && high[0] > high[2] && high[0] > high[3]) { // Check to see if day 1 has the highest temperature against days 2,3 and 4.
2
3            printf ("The highest temperature was %d, on day 1\n", high[0]); // Output day 1 as the highest temperature and indicate the temperature value.
4    }
5    else if (high[1] > high[0] && high[1] > high[2] && high[1] > high[3]) { // Same function as the above function for day 1 except this is used for day 2.
6
7            printf ("The highest temperature was %d, on day 2\n", high[1]); // Refer to day 1 printf
8    }
9
10    else if (high[2] > high[0] && high[2] > high[1] && high[2] > high[3]){
11            printf ("The highest temperature was %d, on day 3\n", high[2]);
12    }
13
14    else {
15            printf ("The highest temperature was %d, on day 4\n", high[3]);
16    }
17
18// Switch out high values with low values in order to determine lowest temperature and its corresponding day.
19