Given the Price Value(CP) and Promoting Value(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
Method:
Revenue = (Promoting Value - Price Value) Loss = (Price Value - Promoting Value)
Beneath is the required implementation:
Python 3
|
OUTPUT :
500 Revenue
Time Complexity: O(1)
Auxiliary House: O(1)
Please refer full article on Program to calculate Revenue Or Loss for extra particulars!