C program to find profit/loss/noprofit-noloss when selling any product.

#include<stdio.h>
#include<conio.h>
void main() {
float sp,cp,pl;
clrscr();
printf("Enter Cost price and Sell price of any product\n");
scanf("%f%f",&cp,&sp);
pl=sp-cp;
if (pl>0) 
printf("profit =%f rs\n",pl);
else {
if (pl==0) 
printf("noprofit-noloss\n");
else 
printf("loss=%f rs\n",-pl);
}
getch();
}

No comments:

Post a Comment