subject

#include using namespace std;

double f(double x)
{
return (double) (x*x*x) + (x*x) - 1;
}

double g(double x) //equation of x
{
return (double) sqrt(1/(1+x));
}

int main()
{
double x0, a, b, xn=1;
int iter = 0;
x0 = 0;
a = f(x0);

// finding interval
while(1)
{
x0++;
b = f(x0);

if(a*b < 0)
{
a = x0 - 1;
b = x0;
break;
}

a = b;
}

cout<<"The interval I = ["< 0.0001)
{
x0 = xn;
xn = g(x0);
iter++;

cout<<" "< }

cout<<"\n\nThe root of the equation x^3 + x^2 - 1 = 0 is "<
return 0;
}

Convert this code to c language

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:30
What important technology has done the most to allow a businesses a chance to compete with larger international companies
Answers: 1
question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
Answers: 1
You know the right answer?
#include using namespace std;

double f(double x)
{
return (double) (x*x*x)...
Questions
question
Mathematics, 30.11.2020 22:30
question
Chemistry, 30.11.2020 22:30
Questions on the website: 13722363