Logo

Programming-Idioms

History of Idiom 54 > diff from v4 to v5

Edit summary for version 5 by :

Version 4

2015-08-19, 14:46:09

Version 5

2015-08-20, 10:56:10

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 i,s;
for(i=s=0;i<n;i++)
{
	s+=x[i];
}
Comments bubble
x is an array with size n.