Chef went to a shop and buys a pens and b pencils. Each pen costs x units and each pencil costs y units. Now find what is the total amount Chef will spend to buy a pens and b pencils.

 

Chef went to a shop and buys a pens and b pencils. Each pen costs x units and each pencil costs y units. Now find what is the total amount Chef will spend to buy a pens and b pencils.






OURSHOPKEEPER







#include <iostream>
using namespace std;
int main()
{
    int abxycost = 0;

    cin >> a;
    cin >> b;
    cin >> x;
    cin >> y;

    cost = a * x + b * y;
    cout << cost;
}






    


Click on the above button to download the code.



Post a Comment

If you have furthur QUERIES please let us know

Previous Post Next Post