Bisection - else if(f(xm>0 b= xm else if(f(xm<0 a= xm i= i printf"The root is%f" xm;

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
int i=0; float a= 14.0; float b= 20.0; while (i< 20) { float xm; xm = .5*(a+b); if (-.0001< f(xm) < .0001) { printf( "The root is %f ", xm);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } else if (f(xm)>0) { b= xm; } else if (f(xm)<0) { a= xm; } i= i++ } printf("The root is %f ", xm);...
View Full Document

This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas at Austin.

Ask a homework question - tutors are online