Home > Back-end >  My this a series of procedures I feel there is no error, can run but why not diagram out the results
My this a series of procedures I feel there is no error, can run but why not diagram out the results

Time:09-21

# include "stdio.h"
# include "iostream"
using namespace std;
# define f (x) 4.0/(1 + (x) * (x))
Void main ()
{
Float h=(1.0 0)/4, temp, xk, yk, XKH, ykh, xk1, yk1;
int i;
Temp=f (0); Xk=0;
For (I=1; 1 <4. i++);
{
Xk=xk + h;
Temp=temp + 2 * f (xk);
}
Temp=temp + f (1);
Temp=temp * h/2;
Printf (" \ n of compound trapezoid formula calculation results: % f ", temp);
Temp=0; H=(1.0 0)/2;//the only Simpson formula is divided into two area between
Xk=0; Yk=f (0);//xk - x [k]
For (I=0; I & lt; 2; I++)
{
XKH=xk + h/2; Ykh=f (XKH);
//XKH - x [k + 1/2]
Xk1=xk + h; Yk1=f (xk1);
//xk1 - x [k + 1)
Temp=temp + h * (yk ykh + + 4 * yk1)/6.//add each district on the area between
Xk=xk1;
Yk=yk1;
}
//right endpoint is between a district under the left endpoint
Printf (" \ n of compound Simpson formula calculation results: % f \ n ", temp);
system("pause");
}

CodePudding user response:

Next breakpoint single-step and have a look

CodePudding user response:

reference 1st floor CHXCHXKKK response:
next breakpoint single-step see
breakpoints single step is what
  • Related