Find Selling Price from given Profit Percentage and Cost | C ++ implementation of above approach ; Function to calculate the Selling Price ; Decimal Equivalent of Profit Percentage ; Find the Selling Price ; return the calculated Selling Price ; Driver code ; Get the CP and Profit % ; Printing the returned value
#include <iostream> NEW_LINE using namespace std ; float SellingPrice ( float CP , float PP ) { float P_decimal = 1 + ( PP / 100 ) ; float res = P_decimal * CP ; return res ; } int main ( ) { float C = 720 , P = 13 ; cout << SellingPrice ( C , P ) ; return 0 ; }