Tuesday 24 December 2013

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.( c++ code)

#include<iostream>
using namespace std;
#include<conio.h>
int main()
 {
 float sp,tp,cp,cps;
 cout<<"\nInput the total selling price of 15 itmes and total profit earned respectively";
 cin>>sp>>tp;
 cps=sp-tp;
 cp=cps/15.0;
 cout<<"\nThe cost price of one item is "<<cp;
 return 0;
  /*  Letuswithc:
       this page is designed to help you learn C or C++.
  Understandable C and C++ programming tutorials, compiler reviews, source code, tips and tricks. 
         */
 }

No comments:

Post a Comment