Arithmetic Expressions Flashcards
are the fundamental means of specifying computations in a programming language
Expressions
An arithmetic expression consists of
operators, operands, parentheses, and function calls
In most programming languages, binary operators are … which means they appear between operands
inflix
specifies the order of operations in expressions that contain more than one (1) operator
operator precedence
Three (3) types of operators
- Unary
- Binary
- Ternary
operator has a single operand
unary
operator has two (2) operands
binary
operator has three (3) operands
ternary
Operators are considered … if they are separated by a single operand
adjacent
When an expression has two (2) operators with the same precedence, the expression is evaluated according to its …
associativity
When there are two (2) adjacent operators with the same precedence, the left operator is evaluated first
left associativity
When there are two (2) adjacent operators with the same precedence, the right operator is evaluated first
right associativity
The precedence and associativity rules can be altered by placing … in expressions
parentheses
Variables in expressions are evaluated by fetching their values from memory
true
A … of a function occurs when the function changes either one of its parameters or a global variable
side effect