#include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 6
int main(int argc, char** argv) {
float stddeviation, deviation, sumsqr, variance, mean, x, t, m, sum=0, max, min;
int numdatapts, k;
FILE * inFile;
inFile = fopen("Uniform93.data", "r");
if(inFile == NULL){
printf("\nError opening file. Abort program.\n");
exit(1); }
for (k = 1; k <= MAXSIZE; k++){
fscanf(inFile, "%f", &m);
if (k == 1)
max = min = m;
sum += m;
if (m > max)
max = m;
if (m < min)
min = m;
if (k == 1)
mean = sum / MAXSIZE;
deviation = m - mean;
sumsqr += deviation * deviation;
variance = sumsqr / (MAXSIZE - 1);
stddeviation = sqrt(variance);
}
printf("Mean: %4.4f \n", mean);
printf("Maximum: %4.4f \n", max);
printf("Minimum: %4.4f \n", min);
printf("Standard Deviation: %4.4f \n", stddeviation);
return (EXIT_SUCCESS);
Hi I need help with this code that imports a file with a list of numbers and then outputs the maximum, minimum, average, and standard deviation. So far everything works except for the standard deviation part. Here's the code