Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

accumulate() in c++

accumulate(first, last, sum);
first, last : first and last elements of range 
              whose elements are to be added
              suppose array is 'a'.
sum :  initial value of the sum
Eg: int sum=0;
	accumulate(a.begin(),a.end(),sum);
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
8+2 =