OPERATORS IN C++
Operators are the foundation of any programming language. Thus the functionality of C++ programming
language is incomplete without the use of operators. We can define operators as symbols that help us to perform specific
mathematical and logical computations on operands.
Types of Operators
1. Arithmetic operator
2. Relational operator
3. Logical operators
4. Bitwise operator
5. Assignment operator
Arithmetic operator
Arithmetic operators perform some arithmetic operation on one or two operands.
Arithmetic operators are two type:-
 Unary operator (++ , - -)
 Binary operator (+ , - , * , / , %)
Relational operator
 Relational operators define the relation between two entities.
 They are mainly use to compare variable with other variable and constant
 Returns Boolean value.
= = Give true value if both operand have equal value
!= Gives true if both operands are not equal
> Gives true if left operand is more than right operand
< Gives true if left operand is less than right operand
>= Gives true if left operand is more than or equal to right operand
<= Gives true if left operand is less than or equal to right operand
Logical operators
 These operators are used to combine two or more condition .
 Result of the operation is Boolean.
Operator Example Meaning
AND(&&) expression1 && expression2 True only if all the operands are true.
OR(||) expression1 || expression2 True if at least one of the operands is true.
NOT(!) !expression True only if the operand is false.
Bitwise operator
Bitwise operators are the operators that operate on bits and perform bit-by-bit operations.
Operator Description
& Bitwise AND Operator
| Bitwise OR Operator
^ Bitwise XOR Operator
~ Bitwise Complement Operator
<< Bitwise Left Shift Operator
>> Bitwise Right Shift Operator
Assignment operator
 The Assignment operator is used to assign a value to a variable.
 These are operators used to perform an arithmetic function on an operand and assign the new value to the
operand at the same time.
Operator Example Equivalent to
= a = b; a = b;
+= a += b; a = a + b;
-= a -= b; a = a - b;
*= a *= b; a = a * b;
/= a /= b; a = a / b;
X = 50;
Variable Value
THANK YOU

Operators in c++

  • 1.
  • 2.
    Operators are thefoundation of any programming language. Thus the functionality of C++ programming language is incomplete without the use of operators. We can define operators as symbols that help us to perform specific mathematical and logical computations on operands.
  • 3.
    Types of Operators 1.Arithmetic operator 2. Relational operator 3. Logical operators 4. Bitwise operator 5. Assignment operator
  • 4.
    Arithmetic operator Arithmetic operatorsperform some arithmetic operation on one or two operands. Arithmetic operators are two type:-  Unary operator (++ , - -)  Binary operator (+ , - , * , / , %)
  • 5.
    Relational operator  Relationaloperators define the relation between two entities.  They are mainly use to compare variable with other variable and constant  Returns Boolean value. = = Give true value if both operand have equal value != Gives true if both operands are not equal > Gives true if left operand is more than right operand < Gives true if left operand is less than right operand >= Gives true if left operand is more than or equal to right operand <= Gives true if left operand is less than or equal to right operand
  • 6.
    Logical operators  Theseoperators are used to combine two or more condition .  Result of the operation is Boolean. Operator Example Meaning AND(&&) expression1 && expression2 True only if all the operands are true. OR(||) expression1 || expression2 True if at least one of the operands is true. NOT(!) !expression True only if the operand is false.
  • 7.
    Bitwise operator Bitwise operatorsare the operators that operate on bits and perform bit-by-bit operations. Operator Description & Bitwise AND Operator | Bitwise OR Operator ^ Bitwise XOR Operator ~ Bitwise Complement Operator << Bitwise Left Shift Operator >> Bitwise Right Shift Operator
  • 8.
    Assignment operator  TheAssignment operator is used to assign a value to a variable.  These are operators used to perform an arithmetic function on an operand and assign the new value to the operand at the same time. Operator Example Equivalent to = a = b; a = b; += a += b; a = a + b; -= a -= b; a = a - b; *= a *= b; a = a * b; /= a /= b; a = a / b; X = 50; Variable Value
  • 9.