UGC NET Paper 2 (Computer Science)Hard

For the statement x = (a + b) * (a + b) + c, the number of three-address instructions after common sub-expression elimination (via DAG) is:

  1. A. 4
  2. B. 3
  3. C. 5
  4. D. 2

Correct answer: B. 3

t1 = a + b; t2 = t1 * t1; x = t2 + c; without the DAG there would be 4.

More UGC NET Computer Science and Applications questions

Exams that ask this topic