|
What is the value of: 12 - 4/2 + 2 A good answer might be:12, since the expression means: 12 - 2 + 2. | ||||||||||||||||||||||||
Arithmetic OperatorsAn arithmetic operator is a symbol that asks for doing some arithmetic. As the previous question illustrates, if several operators are used in an expression, there is a specific order in which the operations are done. Operators of higher precidence will operate first. There are many operators in Java, so the following shows just a few:
In the chart, operators in the same group have equal precidence. So, for example, plus ("+") and minus ("-") have the same precidence. The unary minus and unary plus operators are used as part of a negative or a positive number. For example, -23 means negative twenty-three. More on this later. | ||||||||||||||||||||||||
QUESTION 14:What is the value of the following expressions (in each expression, do the highest precidence operator first): Click Here after you have answered the question78 - 12 / 4 2 + 6 / 2 - 9 |