i was trying to do this program, but i find it difficult to solve it!!
could you please help me?
this is the question,

write a C program that can find the root of equation using bisection method. given that f(a) is 1st point, f(b) is 2nd point amd f(m) is middle point.
f(x)= x^2 + 5

prog should stop when f(a)-f(b) is less than 0.0000001. program should display root of equation (x, when f(a) or f(b) < 0.0000001), number of iteration used. user should be able to retry again or end the program..


pleasa help me... thanks

the bisection method works like this::

check to see the sign of f(a), f(b) if they are different take their middle point{lets say it is c} and then check again to see if f(c) has different sign with f(a) or f(b)....If its has different sign with f(a) take the middle point between (a,c)....else it has different size with b do the symmetrical take the middle of (c,b)

probably for the problem you should have a function like this:

double f(double x)
{
	return (pow(x,2) + 5
}

then you should have a method that checks for the different signs...

PS:: post what you 've done so far so that we can help more..

PS2:: also check this...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.