title: Iteration count - need help, new to programming
body: <p>I am a newbie and this is my homework for school. The program is suppose to print from 1 to 5 (not 5 to 1) and so far, i have only been able to make the program print from 5 to 1, any assistance with this will be appreciate.
  the program should only use while loop</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace std;
  
  int main (int argc, char *argv[])
  {
      //if statement to check only 2 argument can be passed
      if (argc != 2)
      {
              cout &lt;&lt; "ERROR!" &lt;&lt; endl;
      }
      else
      {
              if (atoi(argv[1]) &lt; 1)          //if statement to check negative numbers
              {
                      cout &lt;&lt; "ERROR!"&lt;&lt; endl;
              }
              int temp = atoi(argv[1]);       //convert the number inthe character argument to integer
              int sum = 0;                    //variable declaration to find the sum passed in the while loop
  
      //the while loop is used to print out the numbers entered in descending order
      while (temp &gt; 0)
      {
              cout &lt;&lt; temp &lt;&lt; endl;           //output numbers in the iteration
              sum = sum + temp;               //sums the number of iteration
              temp --;                        //counter, used to stop the while loop to avois an infinity loop
      }
  
      cout &lt;&lt; "Sum is " &lt;&lt; sum &lt;&lt; endl;
      }
  
      return 0;
  </code></pre>
  
  <p>}</p>