#include "../../std_lib_facilities.h"
double my_sqrt_1(double n); // Is this a prototype? no n in parameter
// Start of a function? use a { instead of ;
double upper_bound;
double lower_bound;
{ // No function name in front of bracket
double x = 1; // x is not used
for (int i = 0; i < 10; ++i)
{
if (n < 1)
{
lower_bound = (n);
}
elseif (n > 1)
{
lower_bound = (1 + (n - 1) / 2 - (n - 1)*pow(2) / 8); // Is pow declared??
upper_bound = ((n + 1) / 2);
}
}
} // Are you returning a variable or should this function be a void ???
int main()
{
double n;
for (auto k : { -100, -10, -1, 0, 1, 10, 100 })
{
n = M_PI*pow(10.0, k); // M_PI not declared
cout << n << " ," << sqrt(n) << " ," << my_sqrt_1(n) << '\n'; // sqrt not declared
}
}