C++ Program: A shop will give discount of 10% if the cost of purchased quantity is more than 1000.

0 0
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;
};
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
100%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “C++ Program: A shop will give discount of 10% if the cost of purchased quantity is more than 1000.

  1. Wow, fantastic blog structure! How long have you been blogging for?
    you make blogging look easy. The overall glance of your web site is great, let alone the content material!

Leave a Comment