MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

THEORY OF COMPUTATION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the following expression an example of?3 4 +
A
Infix expression
B
Postfix expression
C
Afterfix expression
D
Between expression
Explanation: 

Detailed explanation-1: -For example, the infix expression (2+3)*(4+5) in postfix notation is 23+45+* and the infix expression 2+3*4+5 in postfix notation is 234*+5+. Also, since our four operators are left associative, 2 + 3 + 4 translates to 23+4+ and not 234++.

Detailed explanation-2: -1 Answer. Hence, value = (2 + 3) * (4 – (5 – 6)) = 5 *(4 – (-1)) = 5*5 = 25.

Detailed explanation-3: -What is the postfix expression of 9+3*5/(10-4)? So the output is:9 3 5 / * + 10 4-. 7.

Detailed explanation-4: -A + B * C would be written as + A * B C in prefix. The multiplication operator comes immediately before the operands B and C, denoting that * has precedence over +. The addition operator then appears before the A and the result of the multiplication. In postfix, the expression would be A B C * +.

There is 1 question to complete.