Hello
The code that I just should be what you need. You just have to modify it a little bit. But by all means this is not the most elegant method of doing this I originally wrote this program when i was learning arrays.
Code:
#include <stdio.h>
#define SIZE 12
int main()
{
float r[SIZE], total=0, x;
int i;
printf("Enter the rainfall data in milimeters for the month of January: ");
scanf("%f",&r[0]);
printf("Enter the rainfall data in milimeters for the month of February: ");
scanf("%f",&r[1]);
printf("Enter the rainfall data in milimeters for the month of March: ");
scanf("%f",&r[2]);
printf("Enter the rainfall data in milimeters for the month of April: ");
scanf("%f",&r[3]);
printf("Enter the rainfall data in milimeters for the month of May: ");
scanf("%f",&r[4]);
printf("Enter the rainfall data in milimeters for the month of June: ");
scanf("%f",&r[5]);
printf("Enter the rainfall data in milimeters for the month of July: ");
scanf("%f",&r[6]);
printf("Enter the rainfall data in milimeters for the month of August: ");
scanf("%f",&r[7]);
printf("Enter the rainfall data in milimeters for the month of September: ");
scanf("%f",&r[8]);
printf("Enter the rainfall data in milimeters for the month of October: ");
scanf("%f",&r[9]);
printf("Enter the rainfall data in milimeters for the month of November: ");
scanf("%f",&r[10]);
printf("Enter the rainfall data in milimeters for the month of December: ");
scanf("%f",&r[11]);
for(i=0; i<=SIZE-1; i++)
{
x=(total+= r[i])/12;
}
printf("Total milimeters of rainfall during the year is %fmm\n",x);
return 0;
}