Calling a function

What do I put in main to call this function? I either get an error or it just does not get called

[void med(int howmany, int grades[])
{
if (howmany % 2 != 0){
int temp = ((howmany + 1) / 2) - 1;
cout << "The median is " << grades[temp] << endl;
}
else{
cout << "The median is " << grades[(howmany / 2) - 1] << " and " << grades[howmany / 2];
}
}]
Last edited on
Please use [code][/code] tags around code.

Please show us how you are calling the function so we can see what you are doing incorrectly.
Topic archived. No new replies allowed.