C program to find profit or loss.


C program to find profit or loss.
Answer:
#include<stdio.h>
int main()
{
int cp,sp,p,l;
printf("enter sp and cp");
scanf("%d%d",&sp,&cp);
if(sp>cp)
{
    p=sp-cp;
    printf("Profit=%d",p);
}
else
{
    l=cp-sp;
    printf("Loss=%d",l);
}
return 0;
}