Choose the equivalent prefix form of the following expression (a + (b − c))*…

2017

Choose the equivalent prefix form of the following expression (a + (b − c))* ((d − e)/(f + g − h))

  1. A.

    * +a − bc /− de − +fgh

  2. B.

    * +a −bc − /de − +fgh

  3. C.

    * +a − bc /− ed + −fgh

  4. D.

    * +ab − c /− ed + −fgh

Attempted by 337 students.

Show answer & explanation

Correct answer: A

To convert the infix expression (a + (b − c)) * ((d − e)/(f + g − h)) to prefix form, we move each operator before its operands.

1. Convert (b − c) to prefix: - b c

2. Convert (a + result) to prefix: + a - b c

3. Convert (d − e) to prefix: - d e

4. Convert (f + g − h) to prefix: - + f g h

5. Convert division part to prefix: / - d e - + f g h

6. Combine both parts with multiplication: * + a - b c / - d e - + f g h

The equivalent prefix form is * + a - b c / - d e - + f g h.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro