if the total selling price of 15 items and the total profit
earned on them is input through the keyboard, write a program
to find the cost price of one of the item
Answer Posted / gagan kumar
void main()
{
int sell_pr, profit, cost_pr, cost_pr_one_item ;
clrscr();
printf(“Please enter the selling price of 15 items:”);
scanf(“%d”, &sell_pr);
printf(“Please enter the profit earned on 15 items:”);
scanf(“%d”, &profit);
cost_pr = sell_pr – profit;
cost_pr_one_item = cost_pr/15;
printf(“Cost price of one item is %d”, cost_pr_one_item);
getch();
}
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is operator precedence?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
Do pointers need to be initialized?
Explain what is the difference between functions getch() and getche()?
When can a far pointer be used?
What is a memory leak? How to avoid it?
What is the difference between constant pointer and constant variable?
What does node * mean?
What is malloc and calloc?
Which is best linux os?
What are void pointers in c?
explain what is an endless loop?
What is switch in c?
What is a static function in c?
Explain the properties of union.