1. The order in which operator are performed determines the result. Consider the expressions 3 + 4 * 2. Over here if addition is done first, the result is 14. However, if multiplication is done first then result is 11.
2. The hierarchy of operations, or order of operations, or order of precedence, in arithmetic expressions from highest to lowest is:
a. Exponentiation
b. Multiplication and Division
c. Addition and Subtraction
3. In the previous example, the multiplication is done before addition, and the result is 11. to change the order of evolution, use parenthesis:
(3 + 4) * 2 will yield 14 as the result. One set of parenthesis can be used inside another set. In the case, parenthesis are said to be nested.
Dinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.
Related Articles
Basic Courses
Advance Courses