title: Recursive factorial function not working properly
body: <p>Why this recursive function can only calculate up to (20!) ? When I input 21 it shows unexpected result.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  long long int factorial( long long int number )
  {
      if( number &lt;= 1 )
          return 1;
  
      return number * factorial( number - 1 );
  </code></pre>
  
  <p>}</p>
  
  <pre><code>int main()
  {
      long long int number;
      while( cin &gt;&gt; number )
              cout &lt;&lt; factorial( number ) &lt;&lt; endl; // factorial( 20 ) = 2432902008176640000
                                                   // factorial( 21 ) = -4249290049419214848 ????
      return 0;
  }
  </code></pre>