fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. double price, price_vat, total;
  5. int vat = 7;
  6. printf("ราคาก่อน VAT : ");
  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.04s 25764KB
stdin
Standard input is empty
stdout
#include <stdio.h>

int main() {
    double price, price_vat, total;
    int vat = 7;
    printf("ราคาก่อน VAT : ");
    scanf("%lf", &price);

    price_vat = ( price * vat ) / 100;
    printf("VAT 7 : %.2lf\n", price_vat);

    total = price + price_vat;
    printf("ราคารวม VAT : %.2lf", total);
    return 0;
}