J
Joe Estock
matt said:After a lot of playing around here is what I not have:
#include <stdio.h>
#define STAX .0825
int main(){
double price;
printf("What is the price?\n");
scanf("%f", &price);
printf("%f\n", (double)price);
Why the unnecessary cast to a double when price is already declared as such?
price = price * STAX;
printf("The sales tax is: %.2f\n", price);
Use %lf as another poster in this thread suggested.
return 0;
}
When prompted for a price I put in 9.99 and here is what is returned:
What is the price?
9.99
521666.640505
The sales tax is: 43037.50
Not exactly what I expected.
Joe