arrow
arrow
arrow
Which of the following prefix expressions is obtained on converting the infix expression A * ( B - C )?
Question

Which of the following prefix expressions is obtained on converting the infix expression A * ( B - C )?

A.

A B C * -

B.

- A * B C

C.

* - A B C

D.

* A – B C

Correct option is D

Step-by-Step Conversion:

Infix expression:

A * (B-C)

Step 1: Identify the operators and operands

  • B - C is evaluated first (inside parentheses)
  • Result is then multiplied by A

Step 2: Convert from infix to prefix (operator before operands)

  • B - C → - B C
  • A * (B - C) → * A - B C

So, the correct prefix expression is:
*A - BC

Important Key Points:

  1. Prefix notation (Polish notation) places the operator before its operands.
  2. Brackets in infix expressions help determine operation priority.
  3. Conversion to prefix involves recursively processing operators inside out, maintaining precedence.

Knowledge Booster:

  • A B C * -: This is in postfix (Reverse Polish Notation) form, not prefix.
  • - A * B C: Incorrect operator placement; does not reflect correct grouping.
  • * - A B C: Incorrect operand order — A is multiplied, not subtracted.

Free Tests

Free
Must Attempt

UP SI 2025 Full Mock Test : 01

languageIcon English
  • pdpQsnIcon160 Questions
  • pdpsheetsIcon400 Marks
  • timerIcon120 Mins
languageIcon English
Free
Must Attempt

UP Police Constable Full Mock Test 01

languageIcon English
  • pdpQsnIcon150 Questions
  • pdpsheetsIcon300 Marks
  • timerIcon120 Mins
languageIcon English
Free
Must Attempt

Government Policies and Scheme

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon5 Mins
languageIcon English
test-prime-package

Access ‘UPSSSC’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
354k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow