The equivalent infix expression and value for the postfix form 1 2 + 3 * 4 5 * – will be ___________
a) 1 + 2 * 3 – 4 * 5 and -13
b) (2 + 1) * (3 – 4) * 5 and 13
c) 1 + 2 * (3 – 4) * 5 and -11
d) (1 + 2) * 3 – (4 * 5) and -11
Answer: d
Explanation: Given postfix expression : 1 2 + 3 * 4 5 * –
⇒ (1 + 2) 3 * 4 5 * –
⇒ ((1 + 2) * 3) 4 5 * –
⇒ ((1 + 2) * 3) (4 * 5) –
⇒ ((1 + 2) * 3) – (4 * 5)
So, the equivalent infix expression is (1 + 2) * 3 – (4 * 5) and it’s value is -11.
Related Posts
The condition flag Z is set to 1 to indicate _______
When using Branching, the usual sequencing of the PC is altered. A new instruction is loaded which is called as ______
While using the iterative construct (Branching) in execution _____________ instruction is used to check the condition
The Instruction fetch phase ends with _________
The two phases of executing an instruction are __________
In a system, which has 32 registers the register id is __________ long.
The instruction, Add R1,R2,R3 in RTN is _______
Join The Discussion