Operator | Syntax | Description |
---|---|---|
< | a < b | Result is true if a is less than b; otherwise, it is false. |
<= | a <= b | Result is true if a is less than or equal to b; otherwise, it is false. |
> | a>b | Result is true if a is greater than b; otherwise, it is false. |
>= | a>=b | Result is true if a is greater than or equal to b; otherwise, it is false. |
Boolean Logical Operators
Operator | Description | Examples | Result |
---|---|---|---|
&& | Conditional -AND | false && false | false |
false && true | false | ||
true && false | false | ||
true && true | true | ||
Conditional -OR | false false | false | |
false true | true | ||
true false | true | ||
true true | true | ||
& | Logical-AND | false & false | false |
false & true | false | ||
true & false | false | ||
true & true | true | ||
Logical-OR | false false | false | |
false true | true | ||
true false | true | ||
true true | true | ||
^ | Logical -XOR | false^false | false |
false^true | true | ||
true^false | true | ||
true^true | false |
Compound Assignment Operators:
Operator | Description | Example | Same Result as |
+= | Increment assignment operator | x += 5; | x = x + 5; |
–= | Decrement assignment operator | x –= 5; | x = x – 5; |
*= | Multiplication assignment operator | x *= 5; | x = x * 5; |
/= | Division assignment operator | x /= 5; | x = x / 5; |
%= | Modulus assignment operator | x %= 5; | x = x % 5; |