GATE 2024 CS (CS2) – Question 43
Consider the expression $x[i]=(p+r)*-s[i]+u/w$. The triples are: (0) + p r; (1) ?; (2) uminus (1); (3) ?; (4) / u w; (5) + (3) (4); (6) ?; (7) = (6) (5). Which one of the following options fills in the missing entries CORRECTLY?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) (1) =[] s i, (3) * (0) (2), (6) []= x i
Explanation
(1) reads s[i] via =[] s i; (2) negates it; (3) multiplies (p+r) by the negation: * (0) (2). (6) forms the array element address x[i] via []= x i, which (7) then assigns to.