Postfix expression - Example

Q.  Evaluate the postfix expression 3574-2^*+
- Published on 22 Jun 15

a. 41
b. 45
c. 48
d. None of the above.

ANSWER: 48
 

    Discussion

  • Nihal   -Posted on 01 Apr 16
    3574-2^*+
    3574-2^*+ -------------------------- Apply ‘–‘ to 7 and 4
    3532^*+ ---------------------------------- Apply ‘^‘ to 3 and 2
    359*+ ------------------------------------------- Apply ‘*‘ to 5 and 9
    3[45]+ ------------------------------------------ Apply ‘+‘ to 3 and 45

    48

    The value of expression 3574-2^*+ will be 48.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)