Numerical Methods: Solution of non-linear equations by using Bisection method in C

Algorithm:

  1. Declare and initialize necessary variables like up_range, mid, low_range etc.
  2. Read the range( upper and lower)  from user within which the root of the equation is to be calculated.
  3. If root lies within the range? if yes: go to step 4. if no: go to step 2
  4. Calculate the mid value of upper and lower range, mid = (upper+lower)/2
  5. Calculate the functional value at mid i.e. func(mid).
  6. If func(mid)*func(low_range) is less than zero, then replace upper range by mid else replace lower range by mid
  7. Display the no of iteration and root
  8. if func(mid) is very small? yes: go to step 9. No: go to step 4
  9. Display the value of most closest and accurate root.

Source Code:

Output:

SHARE Numerical Methods: Solution of non-linear equations by using Bisection method in C

You may also like...

1 Response

  1. Anonymous says:

    wrong h

Leave a Reply

Your email address will not be published. Required fields are marked *

Share