fork download
  1. #include <stdio.h>
  2.  
  3. int main ()
  4. {
  5. /* variable definition: */
  6. float price, SalesTax, SetPrice;
  7. /* Prompt user for price */
  8. printf("Enter the price in dollars: 10.20 \n");
  9. // Input price
  10. scanf("%f", &price);
  11. /* Prompt user for SalesTax */
  12. printf("Enter state sales tax: .05 \n");
  13. // Input SalesTax
  14. scanf("%f", &SalesTax);
  15. // Price with tax is
  16. SetPrice = 10.20 + (10.20 * .05);
  17. // Print the result
  18. printf("Price with tax is : %f\n", SetPrice);
  19. return 0;
  20. }
Success #stdin #stdout 0s 9432KB
stdin
Standard input is empty
stdout
Enter the price in dollars: 10.20 
Enter state sales tax: .05 
Price with tax is : 10.710000