FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 95   



Following program shows you how to calculate discount.
In this program we get bill amount and discount from user and shows after discount amount using following formula
Discount = bill - (bill * discount / 100)

var bill = parseInt(prompt("Enter bill amount:"));
var discount = parseInt(prompt("Enter discount percentage:"));
var afterDiscount = bill - (bill * discount / 100);
console.log("After discount your bill is: " + afterDiscount);

Output:

Enter bill amount:
1000
Enter discount percentage:
20
After discount your bill is: 800



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News