Machine-translated by Google. Questions are authored in English.
Top

Discussion

The expression a + b * c is translated into three address code with one operation per instruction. How many temporaries are introduced?

  • A.3
  • B.0
  • C.2
  • D.1

Answer: C

The multiplication produces one temporary and the addition a second, giving two in all. Each binary operator in the tree contributes exactly one temporary under this scheme. Counting operators is therefore enough to predict the number of temporaries.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.