Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Consider the stack
| 5 |
| 4 |
| 3 |
| 2 |.
At this point, ‘*’ is encountered. What has to be done?

Consider the stack
| 5 |
| 4 |
| 3 |
| 2 |.
At this point, ‘*’ is encountered. What has to be done?
a) 5*4=20 is pushed into the stack
b) * is pushed into the stack
c) 2*3=6 is pushed into the stack
d) * is ignored

Answer: a
Explanation: When an operator is encountered, the first two operands of the stack are popped, evaluated and the result is pushed into the stack.

Join The Discussion