Examples of Expression evaluation

By | April 24, 2018

>>> 2*3+9
15

Above precedence order isĀ  * > +

>>> 2*(3+9)
24

Above precedence order is () > * > +

>>> 10*2+4/2
22.0

>>> 10*(2+4/2)
40.0

Nevertheless expression in braces always takes the first priority!!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.