operators Flashcards
operators
symbols performing computations on variables and values
arithmetic operators
operators performing mathematical computations
%
modulus
outputs the remainder of a dividion
++
increment, increases value by 1
before operand: pre-increment
after operand: post-increment
_ _
decrement, decreases value by 1
before operand: pre-decrement
after operand: post-decrement
pre-increment/decrement is applied….?
before the value of a variable is used in an expression
post-increment/decrement is applied….?
after the value of a variable is used in an expression
assignment operators
assign values to a variable
ex: =
+-/*%= operators
perform the arithmetic and then assign the value
ex: B += A is the same as B = B+A
relational operators
check the relationship of two values
1 is returned if the relation is true
0 is returned if the relation is false
*==, >, <, etc.
logical operators
connects two or more expressions, returns either 0 or 1 depending if the compound expression results true or false
&&
logical and
*true if all operands are true
||
logical or
*true if at least one of the operands are true
!
logical not
*reverses the logical state (if condition is true, then not will make it false)
bitwise operators
perform bit-level operations
compiler will not show binaries and will return decimal values