the code:
Expand|Select|Wrap|Line Numbers
- int main ()
- {
- /* variable definition: */
- float price, salestax, setprice;
- /* Prompt user for price */
- printf("Enter the price in dollars: \n");
- // Input the price
- scanf("$%f", &price);
- /* Prompt user for salestax */
- printf("Enter the state sales tax: \n");
- // Input the salestax
- scanf("%f", &salestax);
- // Calculate the setprice
- setprice = price + (price * salestax);
- // Print the result
- printf("price with Tax is: $%f\n", &price);
- return 0;
- }