title: Trying to make a while Loop that subtracts a number until it reaches desired value and if subtraction surpasses desired value, display it and stop
body: <p>I'm new to programming and to c++ so I know this is probably a silly question but I would really appreciate the help. just as the tittle says, I'm trying to make a subtraction while type loop that reaches a desired value, in this case: 0 
  The code uses two random numbers from the user input. The first number is the minuend, the second is the subtrahend 
  However, the problem that I'm having is that if subtraction surpasses desired value, the loop will not display it and the user will see displayed a number higher value than 0. I want to fix so it displays the negative number closest to 0 and then stop. Here's the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      int a;
      int b;
  
  
  
  cout &lt;&lt;" enter a: ";
  cin &gt;&gt; a;
  cout &lt;&lt; "enter b: ";
  cin &gt;&gt; b;
  
  
  while ( a &gt; 0 )
  {
  cout &lt;&lt; a &lt;&lt; '\n';
  a= a-b;
  
  }
  
  return 0;
  }
  </code></pre>
  
  <p>What am I doing wrong, how can I fix it? Thanks</p>