Given the Cost Price(CP) and Selling Price(SP) of a product. The task is to Calculate the Profit or Loss.
Input: CP = 1500, SP = 2000 Output: 500 Profit Input: CP = 3125, SP = 1125 Output: 2000 Loss
Profit = (Selling Price - Cost Price) Loss = (Cost Price - Selling Price)
Below is the required implementation:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Loss when two items are sold at same price and same percentage profit/loss
- Program to calculate the profit sharing ratio
- Program to find the profit or loss when CP of N items is equal to SP of M items
- Calculate the loss incurred in selling the given items at discounted price
- Find cost price from given selling price and profit or loss percentage
- Program to calculate age
- Program to calculate value of nCr
- C program to calculate the value of nPr
- Efficient program to calculate e^x
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Program to Calculate e^x by Recursion
- Program to calculate the value of nCr Efficiently
- Write a program to calculate pow(x,n)
- Program to Calculate the Perimeter of a Decagon
- Program to calculate Percentile of Students
- Program to calculate Electricity Bill
- Program to calculate area of Enneagon
- Program to calculate Root Mean Square
- Program to calculate volume of Ellipsoid
- Program to calculate Area Of Octagon
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.