Computer Science, asked by kushalchoudhary29, 10 months ago

7. Write a program to print find profit or loss by taking cost price and sale price as user input.​

Answers

Answered by sswaraj04
0

Answer:

#include <iostream>

using namespace std;

int main()

{

   int sp,cp,net;

   cout<<"Enter cost price : ";

   cin>>cp;

   cout<<"Enter selling price : ";

   cin>>sp;

   net=sp-cp;

   if(net>=0)

   {

       cout<<"Profit = Rs. "<<net;

   }

   else

   {

       cout<<"Loss = Rs. "<<net*-1;

   }

   return 0;

}

Explanation:

It's written in c++ programming language

Hope it helps :-)

Similar questions