#include #include float func(float x); main() { float x1,x2,x3,eps; int i=0; eps=1.0e-6; printf("Lower limit = "); scanf("%f",&x1); printf("Upper limit = "); scanf("%f",&x2); while(fabs(x1-x2)>eps){ i++; x3=(x1+x2)/2.0; if((func(x1)*func(x3))<0.0){ x2=x3; }else{ x1=x3; } } printf("Iteration=%d x=%15.5f\n",i,x3); return(0); } float func(float x) { float y; y=x-3.0*exp(-x); return(y); }