#include<stdio.h>
#include<conio.h>
#include<math.h>
float f(float n)
{
float s;
s=4-exp(n)-(2*n*n);
return s;
}
main()
{
float a,b,e,k,x,n;
printf("nhap a");
scanf("%f",&a);
printf("nhap b");
scanf("%f",&b);
printf("nhap e");
scanf("%f",&e);
while(1)
{
x=(a+b)/2;
if(f(x)==0)
{
printf("\nx la nghiem can tim%f",x);
break;
}
else
if((f(a)*f(x))<0)
b=x;
else
a=x;
k=k+1;
if((b-a)<e)
goto xong;
}
xong :printf("nghiem can tim la%f",x);
printf("so buoc lap la%f",k);
getch();
}