Question 1943 – Nielit STA 17-12-2017
December 10, 2023Computer-Networks
December 10, 2023Compiler-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
– subtraction (highest precedence)
* multiplication
$ exponentiation (lowest precedence)
What is the result of the following expression ?
3 – 2 * 4 $ | * 2**3
– 61
|
|
64
|
|
512
|
|
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.
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.
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.
Subscribe
Login
0 Comments