|
What is the value of the expression 3/4 ? A good answer might be:0 | |||||||||||
SubexpressionsThe expression 3/4 calls for integer division because both the operands are integers. The expression 3.0/4.0 calls for floating point division because both the operands are floating point. Most of the operators we are interested in take two operands. In each of the following examples the operator has two operands:
However, unary operators take just one operand:
A binary operator will always have exactly two operands. However, sometimes one or both operands of a binary operator is a subexpression. A subexpression is a part of an expression that is by itself a correct expression. In the following, one or both of the operands of the red operator is a subexpression:
| |||||||||||
QUESTION 7:In an expression like 34.12 / 68.0 how do you know if the / means "integer division" or means "floating point division" ? Click Here after you have answered the question |