Evaluation of a Postfix Expression Multiple choice Questions and Answers (MCQs)

YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

CLICK HERE TO DOWNLOAD

Evaluation of a Postfix Expression Multiple choice Questions and Answers (MCQs)

Question 6 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of these operators have the highest order of precedence?
A
'(' and ')'
B
'*' and '/'
C
'~' and '^'
D
'+' and '-'
Question 6 Explanation: 
The highest order of precedence is ~ and ^ followed by '*', ' /', '+', '-' and then braces '(' ')'.

Question 7 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is not an application of stack?
A
evaluation of postfix expression
B
conversion of infix to postfix expression
C
balancing symbols
D
line at ticket counter
Question 7 Explanation: 
Line at ticket counter is an application of queue whereas conversion of infix to postfix expression, balancing symbols, line at ticket counter are stack applications.

Question 8 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
While evaluating a postfix expression, when an operator is encountered, what is the correct operation to be performed?
A
push it directly on to the stack
B
pop 2 operands, evaluate them and push the result on to the stack
C
pop the entire stack
D
ignore the operator
Question 8 Explanation: 
When an operator is encountered, the first two operands are popped from the stack, they are evaluated and the result is pushed into the stack.

Question 9 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following statement is incorrect?
A
Postfix operators use value to their right
B
Postfix operators use value to their left
C
Prefix operators use value to their right
D
In postfix expression, operands are followed by operators
Question 9 Explanation: 
All prefix operators use values to their right and all postfix operators use values to their left.

Question 10 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3.
A
4
B
5
C
6
D
7
Question 10 Explanation: 
The infix expression is a+b*c. Evaluating it, we get 1+2*3=7.

There are 10 questions to complete.