title: can someone explain the purpose of %f and %d to me?
body: <pre><code>#include &lt;stdio.h&gt;
  
   int main(int argc, const char * argv[])
   {
  
      float apples = 1.1;
  
      float bananas = 2.2;
  
      double fruit = apples + bananas;
  
      printf("%f.\n",fruit);
  
      return 0;
  
   }
  </code></pre>
  
  <p>alright.... so why exactly is %f needed in this? i understand that it is printing the decimal notation of "fruit" for me, but why can i not just ask for the program to print the number "fruit"? is it because i HAVE to declare whether i would want "fruit" printed in decimal %f or scientific notation %e? also I have come across %d on occasion. what does that entail?</p>