#include #include int main(void) { double a ,b, d, x, x1; a=-2; b=4; d=0.0000000001; do { x=(a+b)/2; x1=(x-cos(x))*(a-cos(a)); if (x1<0) b=x; else a=x; } while((b-a)>d); x=(a+b)/2; printf("%.10f\n",x); }