Accumulate algorithm incorrect sum
<p>Just began learning about algorithms in c++. My book mentions a simple read-only algorithm defined in the numeric header. It takes three parameters, the first are iterators that specify a range or elements to sum and the third is the initial value of the summation. However when i try to do this:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;numeric&gt;
using namespace std;

int main() {

vector&lt;int&gt; numbers;

//Fill vector with numbers.
for (vector&lt;int&gt;::size_type i = 0; i != 10; i++) {
    numbers.push_back(i);
}

int sum = accumulate(numbers.begin(), numbers.end(), 1);
cout &lt;&lt; numbers.size() &lt;&lt; endl;
cout &lt;&lt; sum &lt;&lt; endl;

system("PAUSE");

return 0;
}
</code></pre>

<p>I get an output of: 10, 46. How can 10 plus 1 be 46? I can't see my error here, thanks for insight. </p>
