printf and scanf
there is something wrong with printf statements here is a sample code which explains the problem
/* Computes net tire slaes*/
#include
int main()
{
int numTires;
float tirePrice, beforeTax, netSale;
float taxRate=.07; /* Sales tax*/
/* Ask user for values*/
printf("How many tires purchased?n ");
scanf(" %d", &numTires);
printf("How much is each tire?n ");
scanf(" %f", &tirePrice);
/*compute the sale*/
beforeTax = tirePrice * numTires;
netSale = beforeTax + (beforeTax * taxRate);
printf("Your total sale is %.2fn", netSale);
return 0;
}
the user should be prompted to insert an integer after the first prompt
the user should be prompted to insert a floating number after the second prompt
or is there something worng with my syntax?
colonel_dirty about Espresso-C