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
When should you not use a type cast?
write a c program in such a way that if we enter the today date the output should be next day's date.
Is fortran faster than c?
why return type of main is not necessary in linux
How can you increase the size of a statically allocated array?
What is pass by reference in functions?
How can I direct output to the printer?
What are near, far and huge pointers?
Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.
What does 3 mean in texting?
What is difference between structure and union with example?
How can I call fortran?
Why do we use & in c?
Is it acceptable to declare/define a variable in a c header?
How macro execution is faster than function ?