fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. /* variable definition: */
  5. float Price, SalesTax, SetTax;
  6. /* prompt user for base*/
  7. printf("Enter the price in dollars:",Price);
  8. // Input the base
  9. scanf("%f",&Price);
  10. /* prompt user for SalesTax */
  11. printf("Enter State sales tax:",SalesTax);
  12. // Input the base
  13. scanf("%f",&SalesTax);
  14. // Calculate the Set Price
  15. SetPrice = Price + (Price * SalesTax);
  16. // Print the result
  17. printf("Write "Price with Tax is" + Price: %f \n", SetPrice);
  18. return 0;
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:7:9: warning: too many arguments for format [-Wformat-extra-args]
  printf("Enter the price in dollars:",Price);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.c:11:9: warning: too many arguments for format [-Wformat-extra-args]
  printf("Enter State sales tax:",SalesTax);
         ^~~~~~~~~~~~~~~~~~~~~~~~
prog.c:15:2: error: ‘SetPrice’ undeclared (first use in this function)
  SetPrice = Price + (Price * SalesTax);
  ^~~~~~~~
prog.c:15:2: note: each undeclared identifier is reported only once for each function it appears in
prog.c:17:17: error: expected ‘)’ before ‘Price’
  printf("Write "Price with Tax is" + Price: %f \n", SetPrice);
                 ^~~~~
prog.c:5:25: warning: unused variable ‘SetTax’ [-Wunused-variable]
  float Price, SalesTax, SetTax;
                         ^~~~~~
stdout
Standard output is empty