C Program to Find Profit or Loss in Business

 C Program to Find Profit or  Loss in Business

/************************************

 C program to find profit or  loss in business

 ****************************************************/

 

 #include<stdio.h>

 #include<conio.h>

 void main()

 {

     float cost_price,selling_price,profit;

     printf("\t\t***Output***\n");

     printf("Enter cost price and selling price\n");

     scanf("%f%f",&cost_price,&selling_price);

     profit=selling_price-cost_price;

     if(selling_price>cost_price)

     printf("Got the profit of  %f. \n",profit);

     else

     printf("Got the loss of  %f. \n",profit);

     printf("End of program");

 }

                   ***Output***

Enter cost price and selling price

2500 2000

Got the profit of  -500.000000.

End of program

टिप्पणी पोस्ट करा

0 टिप्पण्या