Now let's come up a C implementation for the trapezoidal method, using the formula
as our basis. Suppose that we want to implement a function trapezoid that will numerically integrate a function integrand that is defined elsewhere in the program. What should the prototype for trapezoid look like?
The summation that we've come up with suggests a while loop. What should the while loop do?
Try to come up with an implementation of trapezoid before looking at our solution.