EDIT: What I posted before was not helpful. This might be moreso.
using namespace std;
int main(int argc, char *argv)
int i = 0;
cout << "Enter grades, to quit enter 999\n";
cin >> grade[i];
// What if they enter more than 25 grades to be meanies?
while(grade[i-1] != 999 && i < 25);
i = i-1;
// Sort at some point. I just entered numbers in numerical order because I am nice.
for (int j=0; j<i; j++)
cout << grade[j] << endl;
if(i % 2 == 1)
median = grade[ (int)floor(i / 2) ];
median = 0.5f * ( grade[ (i-1) / 2 ] + grade[ i / 2 ] );
// Erg, median is declared as float. Try not to index an array with a float type
//cout << grade[median] << endl;
cout << median << endl;