#include
void main()
{
float cp,sp,p,l;// cp=cost price,sp=seller price, p=profit,l=loss
clrscr();
printf("Enter cost price\t:\t");
scanf("%f",&cp);
printf("Enter cost selling price\t:\t ");
scanf("%f",&sp);
p=sp-cp;
l=cp-sp;
if(p>0)
printf("The seller has made a profit of Rs.%.2f",p);
if(l>0)
printf("The seller is in loss by Rs.%.2f",l);
getch();
}
No comments:
Post a Comment