Hi,

I've got this homework:

Write a program that calculates the Root-Mean-Square (RMS) of a

sequence of numbers whose length and content are determined by the

user. The RMS calculation should be done in a function of prototype

double RMS(double *x, int N), where N is the number of elements

in the array x. Demonstrate its use in a main function which prompts

the user for the length of the sequence, and then the values of this

sequence.

And I've got that far:

It doesn't give me any errors but neither does it work.. Can someone please tell me if I'm on the right track?Code:#include <stdio.h> #include <math.h> double RMS(double *x, int N) { float rms; int i; for (i=0; i<N; i++) { rms=sqrt(x[N^2]); } return rms; } int main() { int i, N; float rms; printf("Please enter the length of the sequence:\n"); scanf("%d", &N); double x[N]; for (i=0;i<N;i++){ printf("Please enter the values:\n", i+1); scanf("%d", &x[N]); } rms=RMS(x,N); printf("%f", rms); return0; }

Thanks