We all know about profit and loss . It is a simple mathamatics. A Shopkeeper buy a product from company
and sell us .
Cost price is total ammount of money by which the shopkeeper buy product from company.
Sell price is the total amount of money , which price sell the product to us .
We all know about profit and loss .
if sell price is grater than cost price , made profit
.
simple formula for profit is
profit = sell price - cost price
ex. A product cost price is Rs. 100 and sell price is Rs. 120. Calculate profit ?
Ans:
profit = s.p - c.p { s.p = sell price , c.p = cost price}
profit = 120 - 100 = 20
profit is Rs. 20 .
By the same way, if sell price is less than cost price , made loss .
simple formula for loss is
loss = cost price - sell price.
ex. A product cost price is Rs. 120 and sell price is Rs. 100. Calculate loss ?
Ans: loss = c.p - s.p { s.p = sell price , c.p = cost price}
loss = 120 - 100 = 20
loss is Rs. 20 .
If the cost price and sell price of an item are input through the keyboard ,
write a program to determine wheather the seller has made profit or incurred loss .
Also determine how much profit he made or loss he incurred
C program to Calculate profit and loss
Let's Go to the code :
Note :Click on the button to copy the text from the text field. Try to paste the text (e.g. ctrl+v) afterwards in a different window, to see the effect.
0 Comments