Hi. im just quite new to c program and i need help on who can give me the source code. This is about Interval search method or OSM in numerical method analysis.

The program should solve a given equation f(x)

example: f(x)= x^2+2x+3

Given the function f(x)=0 (this would be the equation given)

STEP

1. Set the initial value xi.( This should ask the user to input a value of xi)

2. Set the initial increment dx.( This should ask the user to input a value of dx)

3. set the termination condition e.( This will be the absulute value of f(xi+dx) also called the error.)

4. Subsititute (xi+dx) to f(x). (The resulting substitution is now called f(xi+dx). )

xi + dx= (xi+dx), (xi+dx) substituted to the value of x of f(x) w/c results to f(xi+dx)

5. Note the sign of f(x). If there is a change of sign in f(xi+dx) reduce the value of dx. (If the sign of the equation changes after the substitution it should ask to decrease the value of dx by .0001)

6. Check the value of ek=f(xi+dx)>e.( The ek is the new e after the change in sign)

7. Repeat procedure 4 to 6.

pls teach me how. Im just a beginner.