It's quite obvious where the problem is. You highlighted it in >> and <<. Just delete the { character. That's it!
Also, if you want to keep your code readable and maintainable, do not ever do this:
int maximum (double grades [], int N)
{
double ans = -1;
for (int i=0 ; i<N ; i++)
if (grades [i] > ans)
ans = grades [i];
return ans;
}
Do this instead. The curly braces are there to make the code readable, debuggable, and leave no double as to which lines belong in which block. Also, indent your code properly.
int maximum (double grades [], int N)
{
double ans = -1;
for (int i=0 ; i<N ; i++)
{
if (grades[i] > ans)
{
ans = grades [i];
}
}
return ans;
}