Write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by the user

Write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by the user.



#include<iostream>
using namespace std;
int main ()
{
float s,c,pr;
cout<<"\t * Profit and Loss Calculation * "<<endl;
cout<<"\n";
cout<<"Enter the Sale Price of Product "<<endl;
cin>>s;
cout<<"Enter the Cost Price of Product "<<endl;
cin>>c;
pr=s-c;
if (s>c)
{
cout<<"\n";
cout<<"You have total profit of "<<pr;
else if (s<c)
{
cout<<"\n";
cout<<"You have total loss of "<<-pr;
}
else
{
cout<<"You have 0 Profit 0 Loss"<<endl;
}
}


Write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by the user


Write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by the user

Write a program to determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred. Cost price and selling price of an item is input by the user