Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int squars (int x, float y=0);
int main()
{
int i(1);
squars (i);
cout<< "\n"<< "The average is "<< i/100<< "\n";
system("PAUSE");
return 0;
}
int squars (int x, float y[0])
{
while (x<=10)
{
y = x * x + y;
cout<< x*x<< endl;
x++;
}
return y;
} the average of the square roots won't work. what am i doing wrong?