0

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

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by n.aggel
0

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...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.