for(total = 0, k = 0; k < n; k++) total += temps[k]; avgTemp = total / n;