#include<stdio.h>
#include<stdlib.h>
#include<math.h>
double f(double x)
{
return pow(x,3)+2*pow(x,2)-4*x-8;
}
int D(double low,double up,double (*fx)(double))
{
return fx(low)*f(up)<=0;
}
int main()
{
const double low=-10.0;
const double up=+10.0;
double x;
for(x=low;x<=up;x+=1.0)
if(D(x,x+1.0,f))
printf("\n>There is one least root at [%+5.2lf,%5.2lf]",x,x+1.0);
system("PAUSE");
system("CLS");