C Program To Calculate Profit Or Loss
C Program To Calculate Profit Or Loss In this example, you will learn to Calculate Profit Or Loss How Program Works ?? Profit = S.P - C.P Loss = C.P - S.P (Where S.P is Selling Price and C.P is Cost Price) Code For " Calculate Profit Or Loss ". /* Author --> HARSH PATEL */ #include<stdio.h> int main() { float Unit_Price, Sales_Amount, Amount; printf("\nEnter the Actrual Product Cost : "); scanf("%f", &Unit_Price); printf("\nEnter the Sale Price (or Selling Price) : "); scanf("%f", &Sales_Amount); if (Sales_Amount > Unit_Price) { Amount = Sales_Amount - Unit_Price; printf("\nProfit Amount = %.4f", Amount); } else if(Unit_Price > Sales_Amount) { Amount = Unit_Price - Sales_Amount; printf("\nLoss Amount = %.4f", Amount); } else printf("\nNo Profit No Loss!"); return 0; } Output-1 Enter the Actrual Produ...