What is the value of the postfix expression 2 3 + 4 5 6 – – *

Trường Phan

New member
What is the value of the postfix expression 2 3 + 4 5 6 – – *
A. 19
B. 21
C. -4
D. 25
 
Answer: d
Explanation: Given postfix expression : 2 3 + 4 5 6 – – *
infix ⇒ (2 + 3)4 (5 – 6) – *
⇒ (2 + 3)*4 – (5 – 6)
Hence, value = (2 + 3) * (4 – (5 – 6)) = 5 *(4 – (-1)) = 5*5 = 25.
 

Tìm kiếm

Back
Top