given that If a then if c-d then a+c else a*c else a+b
parenthesize it ===> If a then if c-d then a+c else a*c else a+b
therefore first solve if c-d then a+c else a*c
given that if x then y else z represented as ?xyz ===> we know that x?yz is ternary operator in INFIX form ==> ?xyz is ternary operator in PREFIX form ==> therefore you have to use here Prefix forms only.
let c-d = x , a+c = y and a*c = z ===> ?(c-d)(a+c)(a*c) but we need to convert x,y and z also in prefix format..
if c-d then a+c else a*c ===> ?(-cd)(+ac)(*ac) ===> ? - c d + a c * a c
If a then if c-d then a+c else a*c else a+b, for solving this, let x = a, y = if c-d then a+c else a*c and z = a+b ( prefix form of z = + a b )
therefore If a then if c-d then a+c else a*c else a+b ===> ? a ? - c d + a c * a c + a b