Write a class RootFinder to find the Fifth root of the sum of the squares of the first 100 ODD
numbers only
class RootFinder
{
public:
RootFinder();
double squareSum()
{
int sum = 0;
for (int i = 1; i <= 100; i++)
sum += (2 * i - 1) * (2 * i - 1);
return sqrt(sum);
}
};
Comments
Leave a comment