Problem with finding middle value
Hello, I'm starter in C, and I'm trying to find max and middle value of temperatures in n days of one month. My code: ``` #include <stdio.h> #include <stdlib.h> int main() { int i, n, a[35], max; float mid; printf("n= "); scanf("%d", &n); for(i=0;i<n;i++) { printf("a[%d]= ",i); scanf("%d",&a[i]); } max=a[0]; for(i=0;i<n;i++) if (a[i]>max) max=a[i]; printf("Max: %d\n", max); // for(i=0;i<n;i++) mid=a[i]/n; printf("Middle: %1.1f\n", mid); } ``` Problem is that result of middle value is "max temperature/n days". Middle value should be sum of all temperatures/n days. Example: For 5 days, temperatures are 27, 25, 18, 19, 30. Output should be: ``` Max: 30 Middle: 23.8 ``` But my output is: ``` Max: 30 Middle: 6.0 ```