Not getting correct answers from very simple functions <p>Okay, so I'm a complete noob. I'm trying my hand at Project Euler to get better at C++. I'm doing problem #1, but I'm not getting the correct output. When I run it, I get that numTotalThree is -3, and numTotalFive is -5, and that numTotal is 0. There's something wrong with my functions, but I'm not sure what I've done wrong. How do I fix this?</p> <pre><code>#include &lt;iostream&gt; using namespace std; int main() { int amount = 1000; int numOfThree = amount / 3; int numOfFive = amount / 5; int numTotalThree = 0; int numTotalFive = 0; int numTotal = numTotalThree + numTotalFive; cout &lt;&lt; numOfThree &lt;&lt; endl; cout &lt;&lt; numOfFive &lt;&lt; endl; for(int i = 0; i &lt;= numOfThree; i++) { numTotalThree += numTotalThree + 3; } cout &lt;&lt; numTotalThree &lt;&lt; endl; for(int i = 0; i &lt;= numOfFive; i++) { numTotalFive += numTotalFive + 5; } cout &lt;&lt; numTotalFive &lt;&lt; endl; cout &lt;&lt; numTotal &lt;&lt; endl; system("PAUSE"); return 0; } </code></pre>