#include <stdio.h> int main() { float cp,sp; printf("Enter The Cost Price : "); scanf("%f",&cp); printf("Enter The Selling Price : "); scanf("%f",&sp); float p,l; p=(sp-cp); l=(cp-sp); if(cp>sp){ printf("\nLoss = %f",l); } if(sp>cp){ printf("\nProfit = %f ",p); } if(sp==cp){ printf("\nNo Loss , No Profit"); } return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter