text: Loss when two items are sold at same price and same percentage profit / loss | C ++ implementation of above approach . ; Function that will find loss ; Driver Code ; Calling Function
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; void Loss ( int SP , int P ) { float loss = 0 ; loss = ( 2 * P * P * SP ) / float ( 100 * 100 - P * P ) ; cout << " Loss ▁ = ▁ " << loss ; } int main ( ) { int SP = 2400 , P = 30 ; Loss ( SP , P ) ; return 0 ; }