Practice mode Data Structures

What is the postfix form of the infix expression A + B * C − D / E?

Correct answer A. A B C * + D E / −

Explanation

Multiplication and division bind tighter than addition and subtraction, and operators of equal precedence group left to right. So B * C is formed first, then added to A, giving A B C * +. Next D / E becomes D E /, and the subtraction applies last. Writing A B + first would wrongly add A and B before multiplying.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.