write a program to enter cost price and selling price of any product and display profit or loss using if else statement.

#include<stdio.h>
#include<conio.h>
int main()
{
int cp,sp;
printf("enter cost price\n");
scanf("%d",&cp);
printf("enter selling price\n");
scanf("%d",&sp);
if(sp>cp)
{
printf("profit");
}
else
{
printf("loss");
}
return 0;
}

 

Comments

Popular posts from this blog