Home > Back-end >  For bosses to help write a part c I wrote
For bosses to help write a part c I wrote

Time:09-22

CodePudding user response:

# include
# include
Int main ()
{double integral, double (double) (*), double, double, int n);
Double fsin (double);
Double fcos (double);
Double a1, b1 and a2, b2, c, (* p) (double);
Int n=20;
Printf (" input a1, b1: ");
Lf the scanf (" % % lf ", & amp; A1, & amp; B1);
Printf (" input a2, b2: ");
Lf the scanf (" % % lf ", & amp; A2, & amp; B2);
P=fsin;
C=integral (p, a1, b1, c);
Printf (" The integral of sin (x) is: % lf \ n ", c);
P=fcos;
C=integral (p, a2, b2, c);
Printf (" The integral of cos (x) is: % lf \ n ", c);
return 0;
}
Double integral, double (* p) (double), double a, double b, int n)
{
int i;
Double x, h, s,
H=(b - a)/n;
X=a;
S=0;
for(i=1; i<=n; I++)
{x=x + h;
S=s + (* p) (x) * h;
}
The return (s);
}
Double fsin (double x)
{
Return sin (x);
}
Double fcos (double x)
{
Return cos (x);
}

CodePudding user response:

There are a great god help to improve it

CodePudding user response:

Are there any big don't sink

CodePudding user response:

your question is too complicated!

CodePudding user response:

The
spending package le 氶 reference 4 floor response:
your question is too complicated!
third don't know how to write, I'm just the first two will probably

CodePudding user response:

Is the use function

X x x x x/3 + + x x x x

CodePudding user response:

The
refer to 6th floor? Victor.?? Response:
is to use the function!

X x x x x/3 + + x x x x
the third has no function

CodePudding user response:

Put one code as big brothers to give directions
  • Related