Write a program to enter sp and cp and calculate profit and loss
Answers
Answered by
0
#include<stdio.h>
int main()
{
int sp, cp;
printf("enter cost price:")
scanf("%d",&cp);
printf("enter selling price:");
scanf("%d",&sp);
if(cp<sp)
{
profit =sp-cp;
printf("profit is %d",profit)
}else
{
loss=cp-sp:
print("loss of rs %d", loss);}
}
}
Similar questions