here is the c program for arriving at a solution using bisection method.(adsbygoogle = window.adsbygoogle || []).push({});

The ouputi s going infinte..pls help ....i think it has more of syntax errors than logical errors...

Code (Text):

main()

{

float a,b,c,x1,x2,x,series;

double d;

printf("enter a,b,c and x1(pos) & x2(neg)");

scanf("%f%f%f%f%f", &a, &b, &c, &x1, &x2);

read:

x = (x1 + x2) / 2;

series = a * x * x + b * x + c;

d = fabs(series);

if (d > 0.0001)

{

if (x * x1 < 0)

x = x2;

else

x = x1;

goto read;

}

else

{

printf("ans=%f", x);

}

return 0;

}

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Bisection method by c

**Physics Forums | Science Articles, Homework Help, Discussion**