#include<stdio.h>
int n = 5;
float list[] = {3, -2, 12, 4.4, 3.5};
main()
{
int count;
float avg, d, sum = 0;
/* calculate and display the average*/
for(count = 0; count < n; ++count)
sum += list[count];
avg = sum/n;
printf("\n The average is %5.2f\n\n" , avg);
/* calculate and display the deviations about the average*/
for (count = 0; count <n; ++count)
{
d = list[count] - avg;
printf("i = %d x = %5.2f d = %5.2f\n", count + 1, list[count], d);
}
}