The loop is particular in the sense it is based on an iterator i and the number of computations is known. In such a case, it is convenient to use a finite loop for:
int r=1;
for (int i=1; i<=n; i++)
r *= i;
return r;
6 - 6
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