How can I write this statement:
9-3/(1+2)
... from infix to postfix?
How can I write this statement:
9-3/(1+2)
... from infix to postfix?
You can use the Shunting-yard algorithm to convert from infix to postfix notation.
9-3/(1+2)
First would be (1+2) since it has the highest order of operation.
-> 1 2 +
Then 3 divided by the result...
-> 3 1 2 + /
Then 9 minus the result....
-> 9 3 1 2 + / -