title: How to convert int to float in C?
body: <p>I am trying to solve:</p>
  
  <pre><code>int total=0, number=0;
  float percentage=0.0;
  
  percentage=(number/total)*100;
  printf("%.2f", percentage);
  </code></pre>
  
  <p>If the value of the number is 50 and the total is 100, I should get 50.00 as percentage and that is what I want. But I keep getting 0.00 as the answer and tried many changes to the types but they didn't work.</p>