title: Generate all natural numbers that have 3 digits whose 3rd digit - 1st digit=2nd digit
body: <p>The problem's in the title.
  If possible please give me exaplanations on what I did wrong and why correct solution is correct.</p>
  
  <p>My attempt at solving it is in the code below... it was supposed get me all the 3 digit numbers then extract <code>digit1</code>, <code>digit2</code> and <code>digit3</code> from each number after which it should show the numbers that respect the <code>digit3-digit1==digit2</code>.
  The program runs without errors but at the same time it doesn't really do anything.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      int Number,digit1,digit2,digit3,h;
      for (Number=100; Number&lt;=999; Number++)
      {
          h=Number;
      }
      digit1=h/100;
      digit2=(h/10)%10;
      digit3=h%10;
      if (digit3-digit1==digit2)
          cout&lt;&lt;digit1&lt;&lt;digit2&lt;&lt;digit3;
      return 0;
  }
  </code></pre>