The newspaper Agency
Each Sunday, a newspaper agency sells w copies of a special edition newspaper for Rs.x per copy. The cost to the agency of each newspaper is Rs.y. The agency pays a fixed cost for storage, delivery and so on of Rs.100 per Sunday. The newspaper agency wants to calculate the profit which it obtains only on Sundays. Can you please help them out by writing a program to compute the profit if w, x, and y are given.
INPUT FORMAT:
Input consists of 3 integers:
w, x, and y.
w is the number of copies sold, x is the cost per copy and y is the cost the agency spends per copy.
OUTPUT FORMAT:
The output consists of a single integer which corresponds to the profit obtained by the newspaper agency.
Answers
Answered by
0
Program in C++:
#include<iostream>
using namespace std;
int main()
{
int w, x, y;
cout<<"Enter the number of copies sold : ";
cin>>w;
cout<<"Enter the cost per copy : ";
cin>>x;
cout<<"Enter the cost the agency spends per copy : ";
cin>>y;
int profit = (w * x) - (w * y) - 100;
cout<<"The profit obtained by the newspaper agency : "<<profit;
return 0;
}
Output:
Enter the number of copies sold : 1000
Enter the cost per copy : 2
Enter the cost the agency spends per copy : 1
The profit obtained by the newspaper agency : 900
Similar questions