title: scanf doesn't read in int properly
body: <p>I've also tried adding fflush(stdout); after the printf statement and that didn't do anything, and neither did using fflush(stdin) before the scanf</p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  
  float cost(int qty)
  {
      if (qty &lt;= 20)
          return qty * 23.45;
      if (qty &gt;= 21 &amp;&amp; qty &lt;= 100)
          return qty * 21.11;
      if (qty &gt; 100)
          return qty * 18.75;
      return '0';
  }
  
  // void main() VS Only
  int main()
  {
      int q;
  
      printf("Enter quantity of books wanted: ");
      scanf("&amp;d", &amp;q);
  
      printf("\n\nThe total cost for purchasing books is: $%0.2f\n\n", cost(q));
  }
  </code></pre>