Question 1943 – Nielit STA 17-12-2017
December 10, 2023
Computer-Networks
December 10, 2023
Question 1943 – Nielit STA 17-12-2017
December 10, 2023
Computer-Networks
December 10, 2023

Compiler-Design

Question 246
Consider the following left associative operators in decreasing order of precedence :
– subtraction (highest precedence)
* multiplication
$ exponentiation (lowest precedence)
What is the result of the following expression ?
3 – 2 * 4 $ | * 2**3
A
– 61
B
64
C
512
D
4096
Question 246 Explanation: 
Actually they are given in wrong order.
But according to given question, we are giving precedence is
(((3 – 2) *) 4 $ | * (2**3))
Step-1: 3-2=1
Step-2: 1*4=4
Step-3: 2*3=6
Step-4: 46=4096
Note: When we are assuming ** is single(*) and there is no |* are useless symbols.
Correct Answer: D
Question 246 Explanation: 
Actually they are given in wrong order.
But according to given question, we are giving precedence is
(((3 – 2) *) 4 $ | * (2**3))
Step-1: 3-2=1
Step-2: 1*4=4
Step-3: 2*3=6
Step-4: 46=4096
Note: When we are assuming ** is single(*) and there is no |* are useless symbols.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!