Expressions, Operator Precedence, MATHS w1 Flashcards
1
Q
operator for addition
A
+
2
Q
operator for subtraction
A
-
3
Q
operator for multiplication
A
*
4
Q
operator for division
A
/
5
Q
operator for modulus
A
%
6
Q
when we divide integers do we get doubles or integers
A
integers
7
Q
when doubles are divided do we get doubles or integers
A
doubles
8
Q
what does modulus give us
A
what is the remainder on division eg 7%3=1
9
Q
what is the addition component assignment operator
A
+=
10
Q
what is += equivalent to
A
variable=variable+expression
11
Q
eg, calculate {result += 15/3}, assuming result is 7
A
12
12
Q
order of precedence
A
unary prefix unary postfix multiplicative additive relational equality conditional assignment
13
Q
what are unary prefixes
A
++ –
14
Q
what are unary postfixes
A
+ - (as in negative and positive numbers)
15
Q
what is involved in the multiplicative type
A
- / %