(l) 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 item.
Let Us C by Yashwant Kanetkar
Solution By Muhammad Kaleem UIlah
(l) 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 item.
#include
<stdio.h>
#include
<stdlib.h>
int main()
{
float sellingprice,profit,costperitem;
printf("\n\t\t Enter the total selling
Price = ");
scanf("%f",&sellingprice);
printf("\n\t\t Enter the total profit
= ");
scanf("%f",&profit);
costperitem=(sellingprice-profit)/15;
printf("\n\t\t Cost price of one item
= %f",costperitem);
return 0;
}
Comments
Post a Comment