purpleivan
0
Q:

accumulate c++ stl

accumulate(first, last, sum);
first, last : first and last elements of range 
              whose elements are to be added
sum :  initial value of the sum
2
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);
1
accumulate(first, last, sum, myfun); 
myfun : a function for performing any 
        specific task. For example, we can
        find product of elements between
        first and last.
1

New to Communities?

Join the community