Programming-Idioms

History of Idiom 54 > diff from v36 to v37

Edit summary for version 37 :
New C implementation by user [grules]

Version 36

2019-09-30, 19:25:31

Version 37

2019-10-11, 22:27:06

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Idiom #54 Compute sum of integers

Calculate the sum s of integer list x.

Code
int sum = 0;
for (int i = 0; i < n; ++i) {
  sum += x[i];
}