Read Time:36 Second
A shop will give discount of 10% if the cost of purchased quantity is more than 1000.
Ask user for quantity
Suppose, one unit will cost 100.
Judge and print total cost for user.
#include <iostream> using namespace std; int main() { int qty,cost; cout<<"Please Enter Quantity:"<<endl; cin>>qty; cout<<qty<<endl; cost = qty*100; if(cost>1000) { cout<<"Your Purchase cost is "<<cost<<" and discount value is "<<(cost*10/100)<<endl; cout<<"Payable Cost is "<<(cost-(cost*10/100))<<endl; } else { cout<<"Discount not available"<<endl; } return 0; };
Average Rating