title: Why do I get a conversion from 'double' to 'float', possible loss of data warning?(c)
body: <p>I'm writing a program which basically calculates the duty on a car imported. The user is supposed to input the values the values for the price of the car and the shipment. But when I calculate I get this error which is not good.</p>
  
  <p>//TOTAL DUTY TO BE CHARGED ON A CAR IMPORTED//</p>
  
  <pre><code>main()
  {
  
          float purchaseprice, shipmentcosts, ecowaslevy, importlevy, GCNETlevy, TotalDuty;
  
          printf("Enter the purchase price and shipment cost");
  
  
          scanf("%f,%f", &amp;purchaseprice, &amp;shipmentcosts);
          ecowaslevy = 0.01f, importlevy = 0.25f, GCNETlevy = 0.05f;
          //FORMULAS FOR THE LEVY//
          ecowaslevy = (purchaseprice + shipmentcosts) * (0.01); 
          importlevy = (purchaseprice + shipmentcosts) * (0.25); 
          GCNETlevy =  (purchaseprice + shipmentcosts) * (0.05); 
          //FORMULA FOR TOTAL DUTY//
          TotalDuty = (ecowaslevy + importlevy + GCNETlevy)*(3.2);
          printf("TOTAL DUTY=GHC.%f", TotalDuty);
          system("pause");
  
  }
  </code></pre>
  
  <p>These are the warnings:</p>
  
  <blockquote>
    <p>1>c:\users\david\documents\visual studio 2013\projects\total expenses\total expenses\tot.c(9): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data<br /></p>
  </blockquote>
  
  <p>1>c:\users\david\documents\visual studio 2013\projects\total expenses\total expenses\tot.c(10): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data<br /></p>
  
  <p>1>c:\users\david\documents\visual studio 2013\projects\total expenses\total expenses\tot.c(11): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data<br /></p>