(A) –38
(B) –83
(C) 24
(D) –24
Answer D.
Explanation.
Push 8
Push 4.
Push 2.
Push 5. Stack contents are (8425).
Read +, pop two elements , do operation , and push in the stack. Stack
is(847).
Read -,Pop two elements ,do operation (4-7=-3), push three in stack. Stack
is(8,-3).
Read *, Pop two elements ,do operation (=-24), push three in stack. Stack
is(-24).
Answer is -24
No comments:
Post a Comment
Note: only a member of this blog may post a comment.