Thursday 30 August 2012

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.


main()
{
 float sp,p,cp;
 printf("Enter total selling price and total profit earned on 15 items\n");
 scanf("%f%f",&sp,&p);
 cp=sp/15-p/15;
 printf("Cost price of one item is %f",cp);
}

output:-

No comments:

Post a Comment