title: Functions using data not given to them
body: <p>How are functions 2 and 3 getting this the integers and floats in there printf's? This is very interesting and would love to know why? Does it have to do with the heap or stack?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  void function1(void){
  int A = 50;
  int B = 42;
  float X = 3.1459;
  float Y = 2.71828;
     printf(“Function 1\n”);
     printf(“%d+%d=%d\n”, A, B, A+B);
     printf(“%f+%f=%f\n”, X, Y, X+Y);
  }
  void function2(void){
  int v1, v2;
  float cs, ua;
     printf(“Function 2\n”);
     printf(“v1+v2=%d\n”, v1+v2);
     printf(“cs+ua=%f\n”, cs+ua);
  }
  void function3(void){
  float cs, ua;
  int v1, v2;
     printf(“Function 3\n”);
     printf(“v1+v2=%d\n”, v1+v2);
     printf(“cs+ua=%f\n”, cs+ua);
  }
  Int main(void){
     function1();
     function2();
     function3();
     return 0;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Function 1
  50+42=92
  3.145900+2.718280=5.864180
  Function 2
  v1+v2=92
  cs+ua=5.864180
  Function 3
  v1+v2=92
  cs+ua=5.864180
  </code></pre>