task:

my attempt:There are a number of ways to normalize, or scale, a set of values. One common normalization technique scales the values such that the minimum value goes to 0, the maximum value goes to 1, and other values are scaled accordingly. For example, using this normalization, we can normalize the values in the following array:

Array values

-2, -1, 2, 0

Normalized array values

0.0, 0.25, 1.0, 0.5

The equation that computes the normalized value from a value xk in the array is

Normalized xk = (xk - min)/(max - min)

where min and max represent the minimum and maximum values in the array x, respectively. If you substitute the minimum value for xk in this equation, the numerator is zero, and thus the normalized value for the minimum is zero. If you substitute the maximum value for xk in this

equation, the numerator and denominator are the same value, and hence the normalized value for the maximum is 1.0.

Write a C program that normalizes a set of data. You may read the data from a data file or from the keyboard. However, the data must be stored in an array. Print out the original and normalized values in a table that is labeled. "

compilation errors: a[normx] subscript needs to be an integer. however in my task, the normalized values need to be float.Code:main() { int x; float a[100], i, normx, max=a[0], min=a[0]; printf("Enter the array separating each by a space:"); scanf("%f",&a[x]); for(x=0; x < 100; x++) { if(a[x]<min) min = a[x]; if(a[x]>max) max = a[x]; } normx = ((float)x-min)/(max-min); printf("\n\n%f",a[normx]); system("PAUSE"); return 0; }

HELP PLEASE!