title: Using %f to print an integer variable
body: <p>The output of the following c program is: <code>0.000000</code></p>
  
  <p>Is there a logic behind the output or is the answer compiler dependent or I am just getting a garbage value?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      int x=10;
      printf("%f", x);
      return 0;
  }
  </code></pre>
  
  <p>PS:- I know that to try to print an integer value using %f is stupid. I am just asking this from a theoretical point of view.</p>