Arithmetic operator-Assignment operator-Comparison operator-Logical operator



Arithmetic operator




Arithmetic operator

S.no.

Operator

Name

Dec

Example

Output



1

2
3
4
5
6

 

+

-
/
%
*
.

 

Addition

Subtraction
Divide
Modules
Multiplication
Concatenation

A

B

 

A+B

A-B
A/B
A%B
A*B
A.B

 

6

2
2
0
8
42

4

4
4
4
4
4

2

2
2
2
2
2



















Assignment operator



Assignment operator

S.no.

Operator

Name

DEC

Example

Output



1

2
3
4
5
6

 

+=

-=
/=
%=
*=
.=

 

Addition

Subtraction
Divide
Modules
Multiplication
Concatenation

A

B

 

A+=b

A-=B
A/=B
A%=B
A*=B
A.=B

 

6

2
2
0
8
42

4

4
4
4
4
4

2

2
2
2
2
2

















Comparison operator



Comparison operator
S.no
Operator
Name
Result
1

2
3
4
5
6
7

==

<=
>=
<> 
!=

Equal to

Less than
Greater then
Less than equal to
Greater then equal to
Not equal
Not equal
True if $A is equal to $B

True if $A is less than $B
True if $A is greater than $B
True if $A is less than or equal to $B
True if $A is greater than or equal to $B
True if $A is not equal to $B
True if $A is not equal to $B



Logical operator



Logical operator
S.no.
Operator
Name
Result
1
2
3.
!
&&
||
Not
And
Or
True if $x is not true
True if both $x and $y are true
True if either $x or $y is true












No comments:

Post a Comment