Loss when two items are sold at same price and same percentage profit / loss | Function that will find loss ; Driver Code ; Calling Function
function Loss ( SP , P ) { var loss = 0 ; loss = ( 2 * P * P * SP ) / ( 100 * 100 - P * P ) ; document . write ( " " + loss . toFixed ( 3 ) ) ; } var SP = 2400 , P = 30 ; Loss ( SP , P ) ;