Home > database >  The c language
The c language

Time:10-07

Dear bosses, why is he dead cycle
#include
#include
#include
# define Z 0.0000001
Float f (float x);
Float p (float float x1, x2);
Int main () {
Float x1, x2,
Float x0.
Float t;
Scanf_s (" % f, % f ", & amp; X1, & amp; X2);
T=p (x1, x2);
Printf (" x "(=% 6.2 f \ n, t);
}
Float p (float float x1, x2)
{
Float x0=(x1 + x2)/2.0;
For (;; )
{
X0=(x1 + x2)/2.0;
If (x0 (x0 * * x0 x0-1) * (x1 * x1 * x1 - x1-1) & lt; Z)
{
X1=x1;
X2=x0;
}
The else
{
X1=x0;
X2=x2.
}
If (fabs (f (0)) & lt; Z)
break;
}
Return x0.
}
Float f (float x)
{
Return * * x x x x - 1;
}
  • Related