You can't get input values and calculate the result in the same loop. Try this:
#include <stdio.h>
#include <math.h>
#define lenght 12
int main()
{
float x[lenght];
float a;
int i;
printf("Enter the average amount of rainfall for each month:\n");
for (i = 0; i < lenght; i++)
{
printf("Enter value for month %d (and press Enter): ", i+1);
scanf("%f", &x[i]);
}
a=(x[0]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10]+x[11])/12;
printf("The average rainfall for the year was %f\n",a);
return 0;
}
Pelle