what is the coding of dev c++ for buying grocery and giving 25% discount on each item
Answers
Answer:
- 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)
- #include <iostream>
int main() {
int main() { int bill;
int main() { int bill; int discount;
int main() { int bill; int discount; std::cout << "Enter bill amount:";
int main() { int bill; int discount; std::cout << "Enter bill amount:"; std::cin >> bill;
int main() { int bill; int discount; std::cout << "Enter bill amount:"; std::cin >> bill; std::cout << "Enter discount percentage:";
int main() { int bill; int discount; std::cout << "Enter bill amount:"; std::cin >> bill; std::cout << "Enter discount percentage:"; std::cin >> discount;
int main() { int bill; int discount; std::cout << "Enter bill amount:"; std::cin >> bill; std::cout << "Enter discount percentage:"; std::cin >> discount; int afterDiscount = bill - (bill * discount / 100);
int main() { int bill; int discount; std::cout << "Enter bill amount:"; std::cin >> bill; std::cout << "Enter discount percentage:"; std::cin >> discount; int afterDiscount = bill - (bill * discount / 100); std::cout << "After discount your bill is: " << afterDiscount;
int main() { int bill; int discount; std::cout << "Enter bill amount:"; std::cin >> bill; std::cout << "Enter discount percentage:"; std::cin >> discount; int afterDiscount = bill - (bill * discount / 100); std::cout << "After discount your bill is: " << afterDiscount;}
Explanation:
* Output: ----»
Enter bill amount: 1500
Enter discount percentage: 15
After discount your bill is: 1275