Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • C
int i,s;
for(i=s=0;i<n;i++)
{
	s+=x[i];
}

x is an array with size n.
int sum = 0;
for (int i = 0; i < n; ++i) {
  sum += x[i];
}
for E of x loop
   S := S + E;
end loop;

x is an array.
S is initialized to be 0.

New implementation...
< >
deleplace