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