The rain (in mm) for the 5 school days is in rain, and sum is already added up. Show Average: 6.2 mm, the average with %.1f. Careful: in sum / 5 both sides are whole numbers, so the result is 6 and the decimals are gone.
Average: 6.2 mm
#include <stdio.h>
int main(void) {
int rain[5] = {12, 0, 7, 3, 9};
int sum = 0;
for (int i = 0; i < 5; i++) {
sum += rain[i];
}
// your code here: printf the average rain (one decimal place)
return 0;
}
Run tries the examples. When they look right, Submit.