You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
#include<math.h>
void main()
{
int i;
float f,x,a,b;
clrscr();
printf("Enter the value of a ::");
scanf("%f",&a);
printf("Enter the value of b ::");
scanf("%f",&b);
do
{
x = (a+b)/2.00;
f = (4*log10((100000)*(sqrt(x)))-(1/(sqrt(x)))-0.4); // any equation can be pu
t here
if (f>0)
b=x;
else
a=x;
printf("\n\n\ta = %f b = %f f = %f",a,b,f);
}
while(b-a>0.0000001);
printf("\n\t The Root of the equation is %f",x);
getch();
}

You might also like