#include <stdio.h>
#include <conio.h>
void main()
{
int c, s, sum;
printf("enter cost price: ");
scanf("%d", &c);
printf("enter selling price: ");
scanf("%d", &s);
if (c > s)
{
sum = c - s;
printf("loss of %d", sum);
}
else if (s > c)
{
sum = s - c;
printf("profit of %d", sum);
}
else
{
printf("Nither profit Nor loss!");
}
getch();
}
OUTPUT
Enter cost price: 500
Enter selling price: 700
Profit of 200
0 Comments