- 3
can anyone help me to solve this postfix expression.. 2 $ 3 + 5 * 2 $ 2 - 6 / 6 ?
i don't know where to start and what to do please help me to solve this.
8 Réponses
+ 3
Jay Parmar hi.
Your question is incomplete. You have not shown any code or specified the programming language you are using.
0
show us your efforts
0
i tried to do following..
2$3=8
8+5=13
13*2=26
26$2=776
776-6=770
770/6=128.33
but as per this, this is infix express evaluation but given question is to evaluate postfix expression..
0
I think, that first numbers will be multiplied and divided, and then added and subtracted. if you do not use brackets in the expression. by default, operators will be prioritized
0
and what does this $ sign mean ?
0
that's the main problem i correctly don't know but may be it's for exponential
0
What programming language you use?
0
The only language I know that uses the dollar operator is Haskell and in Haskell it basically means “evaluate the right side first”
If it’s exponentiation, though, then you messed up the order of operations.
It would be (2**3) + 5(2**2) - (6/6)
8 + 5(4) - 1
8 + 20 - 1
28 - 1
27