The top temperature of each summer day is in the array temps, n days in all. Write hot_days(temps, n) to count the days that were 30 degrees or hotter. With n at 0, return 0.
hot_days({28, 31, 30, 25}, 4)→2hot_days({}, 0)→0int hot_days(int temps[], int n)int hot_days(int temps[], int n) {
int count = 0;
for (int i = 0; i < n; i++) {
// your code here: if this day was 30 or hotter, add 1 to count
}
return count;
}
Run tries the examples. When they look right, Submit.