fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. double price, price_vat, total;
  5. int vat = 7;
  6. printf("ราคาก่อน VAT :70 ");
  7. scanf("%lf", &price);
  8.  
  9. price_vat = ( price * vat ) / 100;
  10. printf("VAT 7 : %.2lf\n", price_vat);
  11.  
  12. total = price + price_vat;
  13. printf("ราคารวม VAT : %.2lf", total);
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
ราคาก่อน VAT :70 VAT 7 : 0.00
ราคารวม VAT : 0.00