CppLearner
CppLearner

Reputation: 17040

help with array

You will write a program that evaluates the integral of sin(x) using the left-hand rectangle rule with 2000 subintervals, over 10 intervals. The intervals to test are [0, 1), [1, 2), …, [8, 9), [9, 10). You will declare an array of type double that can hold 10 elements, and you will use this array to hold all 10 results you get from evaluating each interval.

I am in testing my code, what should be the output? For example, [0, 1)? Any idea?

Thanks.

Upvotes: 1

Views: 122

Answers (1)

Hamish Grubijan
Hamish Grubijan

Reputation: 10820

In case of a sin function you should be able to figure it out. For more complicated cases use this tool:

http://calc.matthen.com/

http://integrals.wolfram.com/index.jsp

Upvotes: 2

Related Questions