===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float cp,sp,p,l;
cout<<"\n Enter the Cost price: ";
cin>>cp;
cout<<"\n Enter the Selling Price: ";
cin>>sp;
if(sp>cp)
{p=sp-cp;
cout<<"\n You have made profit of "<<p<<"!!";}
else
{l=cp-sp;
cout<<"\n You have incurred loss of "<<l;}
getch();
}
CODING
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float cp,sp,p,l;
cout<<"\n Enter the Cost price: ";
cin>>cp;
cout<<"\n Enter the Selling Price: ";
cin>>sp;
if(sp>cp)
{p=sp-cp;
cout<<"\n You have made profit of "<<p<<"!!";}
else
{l=cp-sp;
cout<<"\n You have incurred loss of "<<l;}
getch();
}
===========================================================================
No comments:
Post a Comment