title: Why does an integer interpreted as a double render zero?
body: <p><code>printf("%f", 20);</code> results in the output <code>0.000000</code>, not <code>20.000000</code>. I'm guessing this has to do with how an int is represented in memory and how a double is represented in memory. Surprisingly for me, no matter how I alter <code>20</code>, for example by making the number larger, the output is still <code>0.000000</code>. Could someone please explain the underlying mechanics of this?</p>