Expressions and Arithmetic Operators

Read this chapter, which discusses arithmetic operations in greater detail along with solving expressions with mixed data types.

3. Practice


Answer:

    -23 - 3
The first minus sign is "negation" and the second minus sign is "subtraction". The spaces in the
expression emphasize the different roles, but are not necessary. The following expression is
equivalent:
    -23-3

Practice

Examine the following expressions. Assume that each variable has already been correctly declared. Decide if the expression is correct, then click on the button.


Expression Correct or Not Correct? Expression Correct or Not Correct?
25 25 - value
2( a - b ) (a-b) * (c-d)
A - b/c + D -sum + partial
((x+y) / z) / (a - b) ((m-n) + (w-x-z) / (p % q)


Question 3:

Are arithmetic expressions the only kind of expression?