|
CS256 - Fundamentals of Structured Programming
|
Displaying ./code/operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus (integer remainder from division)
++ Pre/post increment (variables)
-- Pre/post decrement (variables)
() Parenthesis (enclose sub-expressions)
Comparison operators:
== Equality test
!= Not equal (inequality test)
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal
Boolean operators:
! Boolean NOT
&& Boolean AND
|| Boolean OR
a b | !a | !b | a && b | a || b
-------------------------------
0 0 | 1 | 1 | 0 | 0
0 1 | 1 | 0 | 0 | 1
1 0 | 0 | 1 | 0 | 1
1 1 | 0 | 0 | 1 | 1
Misc operators:
= Assignment
& Address of operator
|