Computer Science & C Programming
back
-
next
Revision (2)
How to encode the function
f(x)=(1+x)(1-x)
in
C
?
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 $$
Propose a
program
using a
for
loop to display the preceding value for with
N=10
,
100
and
1000
.
answer
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science
laurent thiry uha mulhouse france programming C algorithm data computer science