This probably doesn't answer the question you are asking
(which isn't that all that clear by the way) but one thing that
struck me when looking at your code is that you need to be
a bit more careful when the input to a function is int and the
output is double or float. Take a look at this noddy example...
As for how to calculate the median, the clue is in the question: ...
int main (void)
int a = 3, b = 2;
c = a/b;
printf("%d/%d = %f (mmm... )\n", a, b, c);
c = (double)a / (double)b;
printf("%d/%d = %f (ahh, that's better...)\n", a, b, c);
sort the list ... find the middle value.