Write A C++ Program To Calculate The Total Expenses If Quantity And Price Per Item Are Input By The User And Discount Of 20% Is Offered If The Expense Is More Than 10000.

Write a C++ program to calculate the total expenses if quantity and price per item are input by the user and discount of 20% is offered if the expense is more than 10000.  

(adsbygoogle = window.adsbygoogle || []).push({}); Program Code:#includeusing namespace std;int main(){
int total_expenses, quantity, price, discount;cout<<"Enter total quantity to be purchased  :";cin>>quantity;cout<cout<<"Enter price of total quantity purchased  :";cin>>price;cout<total_expenses = quantity * price;if(total_expenses>10000){discount=(total_expenses*0.2);total_expenses=total_expenses-discount;}cout<<"Total Expense is  Rs. "<return 0;}

The program output is tested on www.jdoodle.comOutput:Enter total quantity to be purchased : 10Enter price of total quantity purchased : 15000Total Expense is  Rs. 120000

(adsbygoogle = window.adsbygoogle || []).push({}); ThanksMukesh Rajput