Computer Science & C Programming

back - next

Revision (2)

  1. How to encode the function f(x)=(1+x)(1-x) in C ?
  2. By splitting the interval [-1,1] in N equivalent sub-intervals, propose an algorithm to compute the value/area:
    $$ v = \sum_{i=1}^{N} f(2i/N-1)/N $$
  3. Propose a program using a for loop to display the preceding value for with N=10, 100 and 1000.
    answer