title: C generating random values for int variables
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7609041/default-values-of-int-when-not-initialized-in-c-why-do-i-get-different-outputs">Default values of int when not initialized in c. why do i get different outputs?</a>  </p>
  </blockquote>
  
  
  
  <p>Beginner so be lil soft..am compiling a simple code below, I am not assigning any value to my variables but C program generates some random values, why is it so?(Only 2nd variable generates random integers)</p>
  
  <p>So where these values came from?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  main(void) {
      int var1;
      int var2;
  
      printf("Var1 is %d and Var2 is %d.", var1, var2);
      return 0; //Book says I should use this for getting an output but my compiler anyways compile and return me values whether I use it or not
  }
  
  //Output 1st compiled: var1 = 19125, var2 = 8983
  //Output 2nd compiled: var1 = 19125, var2 = 9207
  //Output 2nd compiled: var1 = 19125, var2 = 9127
  </code></pre>