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...
Code:
#include <stdlib.h>
#include <stdio.h>
int main (void)
{
int a = 3, b = 2;
double c;
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);
return 0;
}
As for how to calculate the median, the clue is in the question: ...
sort the list ... find the middle value.