title: Simple C program not calculating correctly
body: <p>So, I'm completely new to programming, and I'm learning to program C. I'm trying to write a simple program in C to calculate commission as follows</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
      float fRate, fSales_Price, fCost, fCommission;
  
      printf("\nEnter your commission rate: ");
      scanf("%.2f",&amp;fRate);
      printf("\nEnter the price of the item sold: ");
      scanf("%.2f", &amp;fSales_Price);
      printf("\nEnter the original cost of the item: ");
      scanf("%.2f", &amp;fCost);
  
      fCommission = (fRate / 100) * (fSales_Price - fCost);
  
      printf("\nYour commission is: %.2f", fCommission);
  }
  </code></pre>
  
  <p>Whenever I try to run it, two things happen. First, if I try to enter any decimals into the program, e.g. if I said the rate was 12.5, it immediately skips the other inputs and completes the program, saying commission is 0.00. If I ignore decimals, the program runs fine until the end, when I still get commission as 0.00. Any suggestions?</p>