Operators are the symbols used to perform different kinds of calculation on different operands.
Types of Operators:
●Arithmetic
●Relational
●Logical
●Assignment
●Increment/Decrement
●Unary/Binary
Arithmetic Operator:
The operator use to perform mathematical operations on different operands.It works with two values.
Types of Operators:
●Arithmetic
●Relational
●Logical
●Assignment
●Increment/Decrement
●Unary/Binary
Arithmetic Operator:
The operator use to perform mathematical operations on different operands.It works with two values.
Relational Operator:
Operator use to perform comparison between two values are called relational operators.Relational operators are:
< less than
> greater than
<= less than equal to
>= greater than equal to
= = equal to
!= not equal to
Operator use to perform comparison between two values are called relational operators.Relational operators are:
< less than
> greater than
<= less than equal to
>= greater than equal to
= = equal to
!= not equal to

Assignment operator
Example
a = 5;
Compound assignment statement
When we are assigning a value to two or more than two variables at one time.
Example
a = b = 5;
Compound assignment operator
The compound assignment operators consist of a binary operator and the simple assignment operator.They perform the operations on the two operands before assigning the result up to the first operand.
Increment OperatorIncrease the value of the variable by one.It is a unary operator and works with one value.It is denoted by the symbol ++.Increment operator cannot increment the value of constants and expressions.
Decrement Operator
Decrease the value of variable by one.It is denoted by the symbol --.It is also a unary operator.
Post Fix
first value is saved then value is Increase/decrease by one.
example A++
Pre FixValue is Increase/decrease by one then then value is save.
example --S
Unary operator
The operator which require only one value for their operations is known as unary operator.
Example
X
|
!
|
T
|
F
|
F
|
T
|
Not Table
Binary operator
The operator which require only two values for their operations is known as binary operator.
Example
And Table
X
|
Y
|
X && Y
|
T
|
T
|
T
|
F
|
T
|
F
|
T
|
F
|
F
|
F
|
F
|
F
|



No comments:
Post a Comment