Your'e missing many points.
At line 13 you try to pass i to your function, although the function doesn't take any parameter.
Plus you tell cout to print a void value. (See the return value of your function)
At line 20 you assign a float (sqrt(i)) to a void function.
So try this :
void sumN(int); // declaration
void sumN(int i){}; // definition
For your approach you actually only need this :
for (int i = 0;i < Q;i++)
{
float result = 0;
for (int j = 0;j < i;j++)
{
result += sqrt(j);
}
cout << result << " ";
}
Output for Q = 6 would look like this :
0 0 1 2.41421 4.14626 6.14626