Please enable JavaScript.
Coggle requires JavaScript to display documents.
Arithmetic Assignment operators (week 6) (operator (example (original…
Arithmetic Assignment operators (week 6)
operator
+=
-=
*=
/=
%=
example
original statement
rate=rate +0.5
new statetment
rate+=0.5
Arithmetic Operators
Operators Operation Precedence
number
( ) Override normal precedence rules 1
Negation (reverse the sign of a number) 2
*, /, % Multiplication, division and modulus arithmetic 3
+, - Addition and subtraction 4
*, /, and % same level !!
+, - (same level)
kalau opertor bercampur gunakan (from left to right)
binary
operators
8-7 ada 2 operand
unary operator
-5 ada satu operand
modulus %
nak ketahui samaada no tersebut even (genap) or odd (ganjil)
Type conversions- static cast
menukarkan no double -> int
static_cast <double > (5)
Type conversion (implicit/explicit)
assigntmet operator
hur = 6.7 ;
not declare int hur=6.7;