Computer Science: Operators
Computer Science: Operators
OPERATORS
INTRODUCTION
The operations are represented by operators and object
of operations are known as operands .
1. Arithmetic Operator
2. Relational Operator
3. Conditional Operator
4. Increment/Decrement Operator
5. Logical Operator
ARITHMETIC OPERATOR
There are three types of arithmetic operator:- Unary operator, Binary operator,
Ternary operator.
UNARY OPERATOR:
The operator that act on single operand are known as Unary Operator
1. Unary + :-This operator precedes an operand. The operand of unary + operator
must have arithmetic or pointer type and results is the value of the argument.
Example: a=5 then +a means 5
a= -5 then +a means -5
Types:
1. Addition operator +
2. Subtraction operator -
3. Multiplication operator *
4. Division operator /
5. Modulus Opearator %
INCREMENT/DECREMENT OPERATORS
Prefix :- ++a
Postfix :- a++
WORKING WITH PREFIX VERSION
5. == (equal to)
6. != (not equal to)
LOGICAL OPERATORS
C++ provides three logical operators to combine existing
expressions.
=> 0 ll 1
=> 1
2. LOGICAL ‘AND’ OPERATOR (&&)
=> 0
3. LOGICAL ‘NOT’ OPERATOR (!)
By
SHIVANI BORTHAKUR
Class – XIth
Sec - B