title: Send output on key press
body: <p>I wrote a simple C++ program that displays a math table:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main()
  {
      int number, result, var=0;
      cout &lt;&lt; "Enter number to generate table:";
      cin &gt;&gt; number;
      while (var &lt; number*10)
      {
          result = number + var;
          cout &lt;&lt; "\n" &lt;&lt; result;
          var += number;
      }
      cin&gt;&gt;var;
      return 0;
  }
  </code></pre>
  
  <p>So when the user types some digits (like e.g. 22) and hits <kbd>Enter</kbd> in the Console Window the table will generate. But I want to show the result instantly as the user types the digits. The user should not be required to hit <kbd>Enter</kbd>.</p>
  
  <p>How do I process the input without the user hitting <kbd>Enter</kbd>?</p>