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))
- A.
* +a − bc /− de − +fgh
- B.
* +a −bc − /de − +fgh
- C.
* +a − bc /− ed + −fgh
- 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.