Monday, April 13, 2009

Calculate price of single item

*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.*/

/*Here the query maker ,I suppose seeks for groce price rate of one item ,as groce profit & groce selling price is sought out
sin => single item groce price ; procin => profit on single item ;con => conjugal price (profit + single item price)
*/

Solution Code :-
==========


#include <stdio.h>
int main(void)
{
int price,profit,sin,prosin,con;
printf("Enter price of 15 items : ");
scanf("%d",&price);
printf("\nEnter profit made on 15 items : ");
scanf("%d",&profit);
sin = price / 15 ;
prosin = (profit / 15) - sin;
con = sin + prosin ;
printf("\nSingle item cost is %d",sin);
printf("\nSingle item profit is %d",prosin);
printf("\nSingle item cost price is %d",con);
return 0;
}

No comments: