title: Why the pow function when used in printf() produce arbitrary results?
body: <p>I have this code in C-</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  int main()
  {
      printf("%d",(12345/pow(10,3)));
  }
  </code></pre>
  
  <p>It outputs any arbitrary value,why is it not outputting 12?
  Isn't the above code equivalent to-</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  int main()
  {
      int i=12345/pow(10,3);
      printf("%d",i);
  }
  </code></pre>
  
  <p>It outputs 12,
  Why the two codes outputting different values?Can someone please explain.</p>