正在加载图片...
printf(The root of requation is%5.2n) The root of equation is 2:00 (9)答案#include<math.h> main() (floatx0.x1.x2.fx0.fx1.fx2: do printf"Enter xl x2:"): scanf(%&x&x2) x11*2*x14*1+3 f2=x2*(x*x2-4)*x2+3)-6 while (fxl*fx2>0) do {x0=(x1+x2)/2 fx0=x0*(2*x0-4)*x0+3-6 if(fx0*f1)<0) {x2=x0,fx2=fx0, else {x1=x0,fx1=fx0:} while(fabs(fx0)-(e-5)) printf("x=%6.5f\n",x0): Enter x1 x2:-10.10 X=2.00 上机实验答案:printf(“The root of requation is %5.2f\n”); } The root of equation is 2:00 (9)答案 #include <math.h> main() { float x0,x1,x2,fx0,fx1,fx2; do { printf(“Enter x1 & x2:”); scanf(“%f,%f”,&x1,&x2); fx1=x1*((2*x1-4)*x1+3)-6; fx2=x2*((x*x2-4)*x2+3)-6; } while (fx1*fx2>0); do { x0=(x1+x2)/2; fx0=x0*((2*x0-4)*x0+3)-6; if ((fx0*fx1)<0) { x2=x0;fx2=fx0;} else { x1=x0;fx1=fx0;} } while (fabs(fx0)>=(e-5)); printf(“x=%6.5f\n”,x0); } Enter x1 & x2:-10,10 x=2.00 上机实验答案:
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有