0
Please can you help me, what is wrong with my code?
https://code.sololearn.com/ckx0bZ1bN4SL/?ref=app Exercise: Try to solve the problem with SIMPSON'S RULE-INTEGRATED APPROXIMATION. f(x)=(3/2)*sin(x)*sin(x)*sin(x) between 0 and π, for integers n=40, 72, 250. https://code.sololearn.com/cqhUdziT14Rb/?ref=app
6 Respuestas
+ 7
Your code is using a lot of stuff from math library but you never included the headers.
#include <math.h>
The error message actually gives you the hint that many things are not declared. Read and understand your errors!
+ 2
Sorry, but you did not really give any clues about your program.
Is it giving a wrong result?
What do you expect as output?
0
Ok, now I repaire it. I will appreciate if somebode tells me the right path.
0
Another approach?
0
Program should calculte the approximation value of the integral of the function f(x)=(3/2)*sin(x)^3. The main point of the program is precision of the result. We are given various integers and for each integer is different approximation.
For example:
dotest(290, 1.9999999986);
dotest(72, 1.9999996367);
dotest(252, 1.9999999975);
dotest(40, 1.9999961668);
It must be taken Simpson rule for calculation of the result.
0
Yes, I have solved it.