Inconsistent loops:
for (int k = 0; k < 10; k++)
should be
length
instead of 10.
There are a couple of other obvious problems, like:
if (min > a[k])
{
min = a[k];
min_index ++;
}
should be
min_index = k;
And your outputs are confusing. Mean: shows the sum and Median: shows the average.
cout << "Mean: " << sum << endl;
int avg = sum/length;
cout << "Median: " << avg << endl;
An average is not a median value.
My advice: Get used to running your programs in a debugger and single-step them in your first run. ALWAYS!
Then get your statistics terms straight. Use Google to lookup the definition of the median value.