WAP to enter cost price and selling price of an item & determine whether the seller has made profit or incurred loss. Also determine how much profit he made or loss he incurred.
#include<iostream.h>#include<conio.h>void main(){int cp,sp,result;cout<<"Enter cost price of item : ";cin>>cp;cout<<"Enter selling price of item : ";cin>>sp;result=sp-cp;if(result>0)cout<<"Profit : "<<result;elseif(result<0)cout<<"Loss : "<<-(result);elsecout<<"No profit no loss";getch();}
Comments
Post a Comment