If what you want is a running average of the last 4 samples, you are not even close.
To do that, you have to keep the last 4 values in an array, and their sum in another variable.
Lets call sum the sum of the last 4, and values[4] the array of the last 4 values.
When a new sample comes in, you subtract the oldest value from the sum:
sum = sum - values[0];
Then you slide down the other 3 values:
for (i=0; i<3; i++) values = values[i+1];
Add the new value into the array:
values[3] = new_value;
And add it to the sum:
sum += new_value;
Once you have processed 4 values, the running average is sum / 4.
You also have a misunderstanding of how function arguments and return values work. You need to work through a tutorial on that until you understand it.
Bob