How do I start a program containing a single dimensional arrays and function(s) with the output displaying the formula “Y = aX + b” by replacing a and b with the calculated values.

Aptitude score Productivity
Applicant variable X Variable Y
1 X1 = 9 Y1 = 46
2 X2 = 17 Y2 = 70
3 X3 = 20 Y3 = 58
4 X4 = 19 Y4 = 66
5 X5 = 20 Y5 = 86
6 X6 = 23 Y6 = 64

1. Compute SUMX = X1 + X2 + X3 + .........+ X6

SUMY = Y1 + Y2 + Y3 + .........+ Y6

SUMXY = X1Y1 + X2Y2 + .........+ X6Y6

SUMXSQ = X1X1 + X2X2 + ........+ X6X6

SUMYSQ = Y1Y1 + Y2Y2 + ........+ Y6Y6

2. Compute MEANX = SUMX/N where N is the total number of X or Y

MEANY = SUMY/N
3. Compute STDDVX = ( )
STDDVY = ( )

4. Compute "a" and "b" in "Y = aX + b" using the following equation
a = (SUMXY-N(MEANX)(MEANY))/(SUMXSQ - N(MEANX^2))
b = MEANY - a(MEANX)

int x[6] = (9,17,20,19,20,23);

int y[6] = (46,70,58,66,86,64);
int i;
sumx=0; for (i=0;i<6;i++) sumx+=x[i];
...