Arithmetic Operators
Name | Symbol | Example | Output |
Addition | + | 2+2 | 4 |
Subtraction | - | 2-2 | 0 |
Division | / | 2/2 | 1 |
Multiplication | * | 2*2 | 4 |
Modulus | % | 2%2 | 0 |
Increment | ++ | let $x=2 ++$x |
3 |
Decrement | -- | let $y=5 --$y |
4 |
Negation | - | let $a=2 -$a |
-2 |
Comparison Operator
Name | Symbol | Example | Output |
is equal | = = | 2= =2 | True |
is not equal | != | 2!=1 | True |
is not equal | <> | 2!=2 | False |
is greater than | > | 2>1 | True |
is less than | < | 3<4 | True |
is less than equal | <= | 2<=4 | True |
is greater than equal | >= | 2>=4 | False |
Tidak ada komentar:
Posting Komentar