#include<stdio.h>
main()
{
int cp,sp,profitloss;
printf ("Enter the cost price and selling price of the item: ");
scanf ("%d %d", &cp, &sp);
profitloss=sp-cp;
if (sp>cp)
{
printf("Profit=%d",profitloss);
}
else if (cp>sp)
{
printf ("Loss=%d",profitloss);
}
else if(sp==cp)
{
printf ("No profit no loss");
}
}
The file can be downloaded at:
Download File
main()
{
int cp,sp,profitloss;
printf ("Enter the cost price and selling price of the item: ");
scanf ("%d %d", &cp, &sp);
profitloss=sp-cp;
if (sp>cp)
{
printf("Profit=%d",profitloss);
}
else if (cp>sp)
{
printf ("Loss=%d",profitloss);
}
else if(sp==cp)
{
printf ("No profit no loss");
}
}
The file can be downloaded at:
Download File
thanks for the solution i hope more
ReplyDeleteNice post and this is a very interested and valuable posting.
ReplyDeleteC Programming Tutorials
C Programming Language
C Programming
C Tutorials
Learn C
Online C Programming Tutorials
Learn C Tutorial
C language with programming examples