A shop will give a discount of 10% if the cost of the purchased quantity is more than 1000.
Ask the user for quantity
Suppose, one unit will cost 100.
Judge and print total cost for the user.
#include<iostream>
using namespace std;
int main()
{
int quantity,oneunit,discount;
cout<<"enter your quantity: ";
cin>>quantity;
oneunit=100;
discount=(quantity*10)/100;
quantity=quantity-discount;
if (quantity>1000)
cout<<"Your price after discount is "<<quantity;
else
cout<<"Your quantity is less than 1000 ";
}
Output:
Tags
c++