View Single Post
Old 10-07-2004, 03:38 PM   #1 (permalink)
Androto
Mac Os X User(I hate win)
 
Join Date: Oct 2004
Posts: 138
Androto is on a distinguished road
help with already written program

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?
Androto is offline   Reply With Quote