Which of the following statements about constant propagation is correct?

2025

Which of the following statements about constant propagation is correct?

Answer: C. It can lead to further optimizations like dead code elimination.Constant propagation replaces variables with their known constant values, enabling optimizations like dead code elimination.

  1. A.

    It applies only to loop variables.

  2. B.

    It eliminates all unused variables.

  3. C.

    It can lead to further optimizations like dead code elimination.

  4. D.

    It increases code size.

Attempted by 64 students.

Show answer & explanation

Correct answer: C

Constant propagation replaces variables with their known constant values, enabling optimizations like dead code elimination.

Explore the full course: Isro

Loading lesson…