title: C++ - my loop keeps on adding up to 0
body: <p>so far here's my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main ()
  {
  int num1 = 0;
  int num2 = 0;
  int sum = 0;
  
  
  for(num2 = num1; num1 &lt;= num2; num1 +=2) sum += num1;
      num1 = num1 / 2 == 0? num1 : num1 + 1;
      num2 = num2 / 2 == 0? num2 : num2 - 1;
  
  cout &lt;&lt; "Enter the First Number:" &lt;&lt; endl;
  cin &gt;&gt; num1;
  cout &lt;&lt; "Enter the Second Number:" &lt;&lt; endl;
  cin &gt;&gt; num2;
  cout &lt;&lt; "Total Sum: " &lt;&lt; sum &lt;&lt; endl;
    } //end for
  </code></pre>
  
  <p>but the sum keeps on adding up to 0 :/</p>
  
  <p>here's the problem.</p>
  
  <p>Create a program that displays the sum of the even numbers between and including two numbers entered by the user.  In other words, if the user enters an even number, that number should be included in the sum.  For example, if the user enters the integers 2 and 7, the sum is 12 (2 + 4 + 6).  If the user enters the integers 2 and 8, the sum is 20 (2 + 4 + 6 + 8 ).  Display an error message if the first integer entered by the user is greater than the second integer.</p>