# Bisection Method C Program

## C Program To Find Root using Bisection Method

Let us learn how to find the root of an interval using bisection method in C programming language. Let us first understand what is bisection method and then let us see the C program for it.

#### What is Bisection method?

The bisection method is basically a root finding method. It bisects (or divides) the intervals, and thereby, selects another sub-interval in which the root must probably occur. The bisection method is used to solve transcendental equations.

The bisection method is used to find the real roots of a non-linear function. An interval basically consists of an end value and a start value, with which the mid-point is calculated.

The bisection method is based on the Intermediate Value Theorem. The bisection method is also popularly known as binary search method, dichotomy method and internal halving method.

The non-linear function used here is: x3 – 4x – 9

#### Bisection Method Theorem

An equation f(x)=0, where f(x) is a real continuous function, has at least one root between a and b, if f(a) f(b) < 0.

The first method describes the implementation of bisection method in C programming using For loop whereas the second method demonstrates the use of If-Else method.

#### Bisection Method Algorithm

• Input an interval(start and end values), continuous function and function values f(a) and f(b).
• Find the mid-point value of the function.
• If the transformation is satisfactory, return the mid-point and then stop the iteration.
• Check the sign value of f(c) and replace the appropriate function and values.

In another way, the algorithm of bisection method can also be represented in the following way:

Given a function f (x) continuous on an interval [a,b] and f (a) * f (b) < 0

#### Output

In case you get any compilation errors in the algorithm of Bisection method in C programming language or if you have any doubts about it, let us know about it in the comment section below.

#### Tushar Soni

I am Tushar Soni, Co - Founder of CodingAlpha. I am a computer science student from India and passionate about Web Development and Programming. Connect with me on Facebook | LinkedIn | Google Plus

### 5 thoughts on “Bisection Method C Program”

• June 2, 2017 at 2:02 pm

The bisection methods seems to be very similar to Newton Raphson method though.

• June 3, 2017 at 8:06 pm

Thanks for the bisection method. I, now, get to understand the power of C programming. Its really amazing.

• June 4, 2017 at 10:40 am

The false position method is much faster than bisection method.