Each Saturday, The Herald sells 'a' copies of a special edition newspaper for Rs.b per copy. The cost to the Herald of each newspaper is Rs.c. The Herald pays a fixed cost for storage, delivery, and so on of Rs.100 per Saturday. The Herald wants to calculate the profit which it obtains only on Saturdays. Can you please help them out by writing a C++ program to compute the profit if a, b, and care is given?
Answers
Answer:
bxhwiidiebdueisokdjejdiciieicieidiisiw
Explanation:
i hope help you
Answer:
The program is constructed using the given problem statement
Explanation:
Input Format:
Input consists of 3 integers --- x, a and b. X is the number of copies sold, a is the cost per copy and b is the cost the agency spends per copy.
Sample Input and Output:
Enter the number of copies sold
1000
Enter the cost of 1 copy of the newspaper
2
Enter the cost spent by the agency on 1 copy of the newspaper
1
The profit obtained is Rs.900
Code:
#include<stdio.h>
int main(){
int n,c,s,o=0;
printf("Enter the number of copies sold\n");
scanf("%d",&n);
printf("Enter the cost of 1 copy of the newspaper\n");
scanf("%d",&c);
printf("Enter the cost spent by the agency on 1 copy of the newspaper\n");
scanf("%d",&s);
o=((n*c)-(n*s))-100;
printf("The profit obtained is Rs.%d",o);
return 0;
}
Test Case 1
Input (stdin)
1000
2
1
Expected Output
profit=900
Test Case 2
Input (stdin)
1000
3
1
Expected Output
profit=1900
Learn more about the profit and loss
- https://brainly.in/question/9176297?referrer=searchResults
- https://brainly.in/question/9493471?referrer=searchResults