title: Multiplication of two integers in C++
body: <p>I have a pretty basic question, but I am not sure if I understand the concept or not. Suppose we have:</p>
  
  <pre><code>int a = 1000000;
  int b = 1000000;
  long long c = a * b;
  </code></pre>
  
  <p>When I run this, <code>c</code> shows negative value, so I changed also <code>a</code> and <code>b</code> to <code>long long</code> and then everything was fine. So why do I have to change <code>a</code> and <code>b</code>, when their values are in range of <code>int</code> and their product is assigned to <code>c</code> (which is <code>long long</code>)?</p>
  
  <p>I am using C/C++</p>