Tuesday, July 16, 2019

Find Profit or Loss

Find Profit Or Loss

find profit or loss


#include<stdio.h>
#include<conio.h>

void main()
{
int a,b,c;
clrscr();
printf("Enter A current Price ");
scanf("%d",&a);
printf("Enter A Selling Price ");
scanf("%d",&b);

if(a>b)
{
c=a-b;
printf("loss..%d",c);
}
else if(b>a)
{
c=b-a;
printf("profit is..%d",c);
}
else if(a==b)
{
printf("Both Are Equal");
}
getch();

}

Output:




EmoticonEmoticon