# Thread: arrays and standard deviation

1. ## arrays and standard deviation

hi, i am working on a program that reads grades of students into an array of type double and computes the mean and standard deviation after throwing out the highest grade and the lowest grade. The maximum number of students is 100. I have figured out how to get the max and min grades however i cannot figure out how to read all the grades into the array and then get the deviation, if anyone could give me some help on this i would appreciate it.

Code:
```#include<stdio.h>
#include<stdlib.h>
#include<math.h>

/* Given an array of real numbers and the effective
size of the array (i.e. count of the numbers in the
array), this function returns the location of the
highest number in the array */

/* Given an array of real numbers and the effective
size of the array (i.e. count of the numbers in the
array), this function returns the location of the
lowest number in the array */

void deleteElement(double grades[], int *n, int loc);
/* Given an array of real numbers, the effective size
of the array and the location of the element to be
deleted, this function deletes that element from the
array by shifting the rest of the elements one
position to the left and decrementing the count by one
*/

/* Given an array of numbers and the effective size of
the array this function computes and returns the mean
*/

/* Given an array of numbers and the effective size of
the array, this function computes and returns the
standard deviation as described in the previous
section */

int main(void)

double StandardDeviation = sqrt(sum/100);
int n, loc, sum, i;
double a[100];

for (i=0; i<100; i=i+1){
scanf("%d" &n);
a[i] = n;
}
/*finds the sum of all grades*/
sum=0;
for (i=0; i<=99; i=i+1)
sum=sum = a[i];

int Minimum( double grades[], int n ){
for ( int i = 0; i < n; i++ );
for ( int j = 0; j < n; j++ );
}

int Maximum( double grades[], int n ){
for ( int i = 0; i < n; i++ );
for ( int j = 0; j < n; j++ );
}

output:

The array contents after these values are deleted:

85.00     76.00     63.50     82.00     55.00

The mean is   72.30
The standard deviation is   11.36```