cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
infix to prefix question
infix to prefix question
Mar 20, 2012 at 3:47pm UTC
rro0035
(37)
the original value is ((7+9)/2-(4+6)*3)/5
i need to convert this to prefix and i got:/*/+792+4635 i'm not entirely sure if i'm correct can somebody please explain what i need to do in terms of order of operations.
thanks in advance
Mar 20, 2012 at 4:34pm UTC
LB
(13399)
For simple mathematical expressions: PEMDAS
Parenthesis
Exponents
Multiply and Divide left to right
Add and Subtract left to right
Last edited on
Mar 20, 2012 at 4:34pm UTC
Mar 20, 2012 at 8:35pm UTC
rro0035
(37)
ok so it follows the same rules but + and - (* and / as well)are ties so when i see them just go from left to right?
Mar 20, 2012 at 8:37pm UTC
LB
(13399)
Correct.
Topic archived. No new replies allowed.