Operators in c++

ABHIJITPATRA23 714 views 9 slides Sep 23, 2021
Slide 1
Slide 1 of 9
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9

About This Presentation

Operators in c++ presentation


Slide Content

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 Arithmetic operator Relational operator Logical operators Bitwise operator 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