Find Selling Price from given Profit Percentage and Cost | Function to calculate the Selling Price ; Decimal Equivalent of Profit Percentage ; Find the Selling Price ; return the calculated Selling Price ; Get the CP and Profit % ; Printing the returned value
< ? php function SellingPrice ( $ CP , $ PP ) { $ P_decimal = 1 + ( $ PP / 100 ) ; $ res = $ P_decimal * $ CP ; return $ res ; } $ C = 720 ; $ P = 13 ; echo SellingPrice ( $ C , $ P ) ; ? >