title: Maximum value that can be stored in an integer type in C++
body: <p>I have the following program in C++</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  #include &lt;cstring&gt;
  #include &lt;cstdlib&gt;
  #include &lt;limits&gt;
  using namespace std;
  
  int main()
  {
      printf("range of int: %d to %d", SHRT_MIN, SHRT_MAX);
      int a = 1000006;
      printf("\n Integer a is equal to %d", a);
      return 0;
  }
  </code></pre>
  
  <p>My question is - How is <code>a</code> able to store an integer larger than the MAX limit?</p>