Skip to content
Related Articles

Related Articles

GATE | Quiz for Sudo GATE 2021 | Question 47

View Discussion
Improve Article
Save Article
  • Last Updated : 18 Dec, 2020
View Discussion
Improve Article
Save Article

Consider the following source code :

c = a + b
d = c
c = c – e
a = d – e
b = b * e
b = d/b

Which of the following is/are NOT correct optimization of given code?

Note – This question is multiple select questions (MSQ).
(A)

c = a + b
      t = b * e
      a = d – e
      b = d/t
      c = a

(B)

c = a + b
      d = c
      c = c – e
      a = d – e
      b = d/b

(C)

d = c
     c = c – e
     a = d – e
     b = b * e
     b = d/b

(D) None of the above


Answer: (A) (B) (C)

Explanation: (A) It modified by a = d – e, but d must contain a+b.
(B) It used old value of b but b = b*e.
(C) Variable d used old value of c, but d = a+b.

All optimizations are not correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!