Operator in c
Operator
An operator is a symbol that tells the computer
to perform certain mathematical and logical manipulation.
Types of operators
:
- Arithmetic operator
- Relational operator
- Logical operator
- Conditional operator
- Bitwise operator
- Assignment operator
Operator
An operator is a symbol that tells the computer
to perform certain mathematical and logical manipulation.
Types of operators
:
- Arithmetic operator
- Relational operator
- Logical operator
- Conditional operator
- Bitwise operator
- Assignment operator
Arithmetic operator
Operator
Symbol
Example
Plus
+
10+5=15
Minus
-
10-5=5
Multiplication
*
10*5=50
Division
/
10/5=2
Modular
% (gives
remainder)
10%5=0
Relational operator
Operator
Meaning
Example
<
Less than
If (10<5)-false
<=
Less than or equal to
If (10<=5)-false
>
Greater than
If(10>5)-true
>=
Greater than or equal to
If(10>=5)-true
==
Equal to
If(10==5)-false
Logical operator
Symbol
Meaning
&&
Logical and
||
Logical or
!
Logical not
Arithmetic operator
Operator
|
Symbol
|
Example
|
Plus
|
+
|
10+5=15
|
Minus
|
-
|
10-5=5
|
Multiplication
|
*
|
10*5=50
|
Division
|
/
|
10/5=2
|
Modular
|
% (gives
remainder)
|
10%5=0
|
Relational operator
Operator
|
Meaning
|
Example
|
<
|
Less than
|
If (10<5)-false
|
<=
|
Less than or equal to
|
If (10<=5)-false
|
>
|
Greater than
|
If(10>5)-true
|
>=
|
Greater than or equal to
|
If(10>=5)-true
|
==
|
Equal to
|
If(10==5)-false
|
Logical operator
Symbol
|
Meaning
|
&&
|
Logical and
|
||
|
Logical or
|
!
|
Logical not
|
0 Comments:
Post a Comment