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
`write a program to display the recomended action depends on a color of trafic light using nested if statments
application attempts to perform an operation?
Why do we use int main instead of void main in c?
Why C language is a procedural language?
why return type of main is not necessary in linux
how can f be used for both float and double arguments in printf? Are not they different types?
How do you sort filenames in a directory?
What is a loop?
What is a good data structure to use for storing lines of text?
What is the use of header?
What is the significance of scope resolution operator?
What is #pragma statements?
Can we declare a function inside a function in c?
What does struct node * mean?
How can I read and write comma-delimited text?