title: Print numbers in range of two user-input values with while loop
body: <p>I feel like I might be missing something here, but something is telling me that I might just be making this more difficult that it has to be, but from the book, "C++ Primer, 5th ed.," I'm stuck on this problem:  </p>
  
  <blockquote>
    <p>Exercise 1.11: Write a program that prompts the user for two integers.
    Print each number in the range specified by those two integers.  </p>
  </blockquote>
  
  <p>Up until this time in the book, the only loop being used is the <code>while</code> loop, and no conditional expressions, like <code>if</code>, have been introduced. The problem would be simple if it were not for the fact that a user could put the values into the integers asked for in ascending or descending order, so simple subtraction WOULD find the difference, but without testing which way to increment.  </p>
  
  <p>How could I absolutely print the range between the numbers, guaranteeing not to just increment towards infinity without testing the outcome of such math and/or without comparing the two numbers? This is what I have; it works when the first value: <code>v1</code> is less than or equal to the second: <code>v2</code>, but not otherwise:  </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()  
  {  
      int v1 = 0, v2 = 0;  
      std::cout &lt;&lt; "Enter two integers to find numbers in their range (inclusive): "  
                &lt;&lt; endl;  
      std::cin &gt;&gt; v1 &gt;&gt; v2;  
      while (v1 &lt;= v2)  
      {  
          std::cout &lt;&lt; v1;  
          ++ v1;  
      }  
      return 0;  
  }  
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>