fork download
  1. #include <stdio.h>
  2.  
  3. double after_sales_tax(amt) {
  4. double sale = amt + (amt * .06);
  5. return sale;
  6. }
  7.  
  8. int main(void) {
  9. printf("Welcome to the 6%% tax calculator!\n");
  10. double total;
  11. printf("Please enter the total amount: ");
  12. scanf("%lf", &total);
  13. printf("The total amount after tax is: $%.2f\n", after_sales_tax(total));
  14. return 0;
  15. }
Success #stdin #stdout 0s 5464KB
stdin
Standard input is empty
stdout
Welcome to the 6% tax calculator!
Please enter the total amount: The total amount after tax is: $0.00