Given the Value Worth(CP) and Promoting Worth(SP) of a product. The duty is to Calculate the Revenue or Loss.
Examples:
Enter: CP = 1500, SP = 2000 Output: 500 Revenue Enter: CP = 3125, SP = 1125 Output: 2000 Loss
Formulation:
Revenue = (Promoting Worth - Value Worth) Loss = (Value Worth - Promoting Worth)
Beneath is the required implementation:
Python 3
|
OUTPUT :
500 Revenue
Time Complexity: O(1)
Auxiliary Area: O(1)
Please refer full article on Program to calculate Revenue Or Loss for extra particulars!