We assume that input is a valid postfix and expect an operator .
else { string op1 = s . top ( ) ; s . pop ( ) ; string op2 = s . top ( ) ; s . pop ( ) ; s . push ( " ( " + op2 + exp [ i ] + op1 + " ) " ) ; } }