SlideShare a Scribd company logo
OPERATORS IN C#
OPERATORS
• An operator is a symbol that tells the compiler to perform specific
mathematical or logical manipulations.
Operators can be categorized based upon their
different functionality :
• ARITHMETIC OPERATORS
• RELATIONAL OPERATORS
• LOGICAL OPERATORS
• BITWISE OPERATORS
• ASSIGNMENT OPERATORS
OPERATORS CAN ALSO
CATEGORIZED BASED UPON NUMBER OF
OPERANDS :
• Unary Operator
• Binary Operator
• Ternary Operator
ARITHMETIC OPERATORS
Operator OPERATOR NAME
+ ADDITION OPERATOR
- SUBTRATION OPERATOR
* MULTIPLICATIONOPERATOR
/ DIVISION OPERATOR
% MODULUS OPERATOR
++ INCREEMENT OPERATOR
-- DECREEMENT OPERATOR
These are used to perform arithmetic operations on operands.
RELATIONAL OPERATORS
Operator OPERATOR NAME
== EQUAL TO
!= NOT EQUAL TO
> GREATER THAN
< LESS THAN
>= GREATER THAN EQUAL TO
<= LESS THAN EQUAL TO
Relational operators are used for comparison of two values.
LOGICAL OPERATORS
• They are used to combine two or more conditions/constraints or to
complement the evaluation of the original condition in consideration.
Operator OPERATOR NAME Example Result
&& Logical And (5<2)&&(5>3) False
|| Logical Or (5<2)||(5>3) True
! Logical not !(5<2) True
BITWISE OPERATOR
• Bitwise and bit shift operators are used to perform bit level operations on
integer (int, long, etc) and boolean data.
Operator Operator Name Example
~ Bitwise Complement
(~A) =-61 In
11000011
& Bitwise AND
(A&B)=12, In
00001100
| Bitwise OR (A|B)=61, In 00111101
^
Bitwise Exclusive
OR(XOR)
(A^B)=49, In 00110001
<< Bitwise left Shift
A<<2=240, In
11110000
ASSIGNMENT OPERATORS
• Assignment operators are used to assigning a value to a variable. Ex:
int a;
a= 10;OPERATOR Operator Name Example
= Value assign from right side to
left operand
C = A + B assigns value of A + B
into C
+= Add and assign C += A is equivalent to C = C +
A
-= Subtract and assign C -= A is equivalent to C = C -
A
*= Multiply and assign C *= A is equivalent to C = C *
A
/= Devide and assign C /= A is equivalent to C = C /
A
%= Modulus and assign C %= A is equivalent to C = C
% A
OPERATOR Operator Name Example
<<= Left shift AND assignment
operator
C <<= 2 is same as C = C <<
2
>>= Right shift AND assignment
operator
C >>= 2 is same as C = C >>
2
&= Bitwise AND assignment
operator
C &= 2 is same as C = C & 2
^= bitwise exclusive OR and
assignment operator
C ^= 2 is same as C = C ^ 2
|= bitwise inclusive OR and
assignment operator
C |= 2 is same as C = C | 2
THANK YOU

More Related Content

What's hot

Operators in C
Operators in COperators in C
Operators in C
Prabhu Govind
 
Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
V.V.Vanniapermal College for Women
 
Relational operators
Relational operatorsRelational operators
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
Deepak Singh
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
Praveen M Jigajinni
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
ABHIJITPATRA23
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
bajiajugal
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
Pranav Ghildiyal
 
Report on c
Report on cReport on c
Report on c
jasmeen kr
 
Operators
OperatorsOperators
Operators
jayesh30sikchi
 
Tableau operators
Tableau   operatorsTableau   operators
Tableau operators
Learnbay Datascience
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
vishaljot_kaur
 
Python operators
Python operatorsPython operators
Python operators
nuripatidar
 
C OPERATOR
C OPERATORC OPERATOR
C OPERATOR
rricky98
 
1
11
C operators
C operators C operators
C operators
AbiramiT9
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
Amit Singh
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
Neeru Mittal
 
Java 2
Java 2Java 2

What's hot (19)

Operators in C
Operators in COperators in C
Operators in C
 
Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
 
Relational operators
Relational operatorsRelational operators
Relational operators
 
Chapter 5 - Operators in C++
Chapter 5 - Operators in C++Chapter 5 - Operators in C++
Chapter 5 - Operators in C++
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
Operator & Expression in c++
Operator & Expression in c++Operator & Expression in c++
Operator & Expression in c++
 
CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++CBSE Class XI :- Operators in C++
CBSE Class XI :- Operators in C++
 
Report on c
Report on cReport on c
Report on c
 
Operators
OperatorsOperators
Operators
 
Tableau operators
Tableau   operatorsTableau   operators
Tableau operators
 
Operators and expressions
Operators and expressionsOperators and expressions
Operators and expressions
 
Python operators
Python operatorsPython operators
Python operators
 
C OPERATOR
C OPERATORC OPERATOR
C OPERATOR
 
1
11
1
 
C operators
C operators C operators
C operators
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
 
Operators and expressions in C++
Operators and expressions in C++Operators and expressions in C++
Operators and expressions in C++
 
Java 2
Java 2Java 2
Java 2
 

Similar to Operators in C#

Csc240 -lecture_5
Csc240  -lecture_5Csc240  -lecture_5
Csc240 -lecture_5
Ainuddin Yousufzai
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001
Ralph Weber
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
Shobi P P
 
Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - Operators
Eng Teong Cheah
 
C# Fundamentals - Basics of OOPS - Part 2
C# Fundamentals - Basics of OOPS - Part 2C# Fundamentals - Basics of OOPS - Part 2
C# Fundamentals - Basics of OOPS - Part 2
iFour Technolab Pvt. Ltd.
 
C++ chapter 2
C++ chapter 2C++ chapter 2
C++ chapter 2
SHRIRANG PINJARKAR
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
Himanshu Kaushik
 
Arithmetic and increment decrement Operator
Arithmetic and increment decrement OperatorArithmetic and increment decrement Operator
Arithmetic and increment decrement Operator
Megha Sharma
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
Asheesh kushwaha
 
Session03 operators
Session03 operatorsSession03 operators
Session03 operators
HarithaRanasinghe
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
Ponmeenakshi1
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
AshokJ19
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
Sri Kaliswari College
 
operators.pptx
operators.pptxoperators.pptx
operators.pptx
ruchisuru20001
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
Anusuya123
 
2. operators in c
2. operators in c2. operators in c
2. operators in c
amar kakde
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
Munazza-Mah-Jabeen
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
sanya6900
 
C# fundamentals Part 2
C# fundamentals Part 2C# fundamentals Part 2
intro to differnt oper.pptx
intro to differnt oper.pptxintro to differnt oper.pptx
intro to differnt oper.pptx
ssuser5ad1571
 

Similar to Operators in C# (20)

Csc240 -lecture_5
Csc240  -lecture_5Csc240  -lecture_5
Csc240 -lecture_5
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
Learn C# Programming - Operators
Learn C# Programming - OperatorsLearn C# Programming - Operators
Learn C# Programming - Operators
 
C# Fundamentals - Basics of OOPS - Part 2
C# Fundamentals - Basics of OOPS - Part 2C# Fundamentals - Basics of OOPS - Part 2
C# Fundamentals - Basics of OOPS - Part 2
 
C++ chapter 2
C++ chapter 2C++ chapter 2
C++ chapter 2
 
Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++Lecture 2 C++ | Variable Scope, Operators in c++
Lecture 2 C++ | Variable Scope, Operators in c++
 
Arithmetic and increment decrement Operator
Arithmetic and increment decrement OperatorArithmetic and increment decrement Operator
Arithmetic and increment decrement Operator
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
Session03 operators
Session03 operatorsSession03 operators
Session03 operators
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
OPERATORS IN C.pptx
OPERATORS IN C.pptxOPERATORS IN C.pptx
OPERATORS IN C.pptx
 
operators.pptx
operators.pptxoperators.pptx
operators.pptx
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
2. operators in c
2. operators in c2. operators in c
2. operators in c
 
Operators and Expressions
Operators and ExpressionsOperators and Expressions
Operators and Expressions
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
C# fundamentals Part 2
C# fundamentals Part 2C# fundamentals Part 2
C# fundamentals Part 2
 
intro to differnt oper.pptx
intro to differnt oper.pptxintro to differnt oper.pptx
intro to differnt oper.pptx
 

Recently uploaded

Why Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdf
Why Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdfWhy Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdf
Why Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdf
Ben Linders
 
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
OECD Directorate for Financial and Enterprise Affairs
 
Pro-competitive Industrial Policy – OECD – June 2024 OECD discussion
Pro-competitive Industrial Policy – OECD – June 2024 OECD discussionPro-competitive Industrial Policy – OECD – June 2024 OECD discussion
Pro-competitive Industrial Policy – OECD – June 2024 OECD discussion
OECD Directorate for Financial and Enterprise Affairs
 
The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...
The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...
The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
Disaster Management project for holidays homework and other uses
Disaster Management project for holidays homework and other usesDisaster Management project for holidays homework and other uses
Disaster Management project for holidays homework and other uses
RIDHIMAGARG21
 
Using-Presentation-Software-to-the-Fullf.pptx
Using-Presentation-Software-to-the-Fullf.pptxUsing-Presentation-Software-to-the-Fullf.pptx
Using-Presentation-Software-to-the-Fullf.pptx
kainatfatyma9
 
Carrer goals.pptx and their importance in real life
Carrer goals.pptx  and their importance in real lifeCarrer goals.pptx  and their importance in real life
Carrer goals.pptx and their importance in real life
artemacademy2
 
XP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to LeadershipXP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to Leadership
samililja
 
The remarkable life of Sir Mokshagundam Visvesvaraya.pptx
The remarkable life of Sir Mokshagundam Visvesvaraya.pptxThe remarkable life of Sir Mokshagundam Visvesvaraya.pptx
The remarkable life of Sir Mokshagundam Visvesvaraya.pptx
JiteshKumarChoudhary2
 
Artificial Intelligence, Data and Competition – LIM – June 2024 OECD discussion
Artificial Intelligence, Data and Competition – LIM – June 2024 OECD discussionArtificial Intelligence, Data and Competition – LIM – June 2024 OECD discussion
Artificial Intelligence, Data and Competition – LIM – June 2024 OECD discussion
OECD Directorate for Financial and Enterprise Affairs
 
The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...
The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...
The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...
OECD Directorate for Financial and Enterprise Affairs
 
BRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdf
BRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdfBRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdf
BRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdf
Robin Haunschild
 
ASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdfASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdf
ToshihiroIto4
 
怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样
怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样
怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样
kekzed
 
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
OECD Directorate for Financial and Enterprise Affairs
 
Pro-competitive Industrial Policy – LANE – June 2024 OECD discussion
Pro-competitive Industrial Policy – LANE – June 2024 OECD discussionPro-competitive Industrial Policy – LANE – June 2024 OECD discussion
Pro-competitive Industrial Policy – LANE – June 2024 OECD discussion
OECD Directorate for Financial and Enterprise Affairs
 
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
 
IEEE CIS Webinar Sustainable futures.pdf
IEEE CIS Webinar Sustainable futures.pdfIEEE CIS Webinar Sustainable futures.pdf
IEEE CIS Webinar Sustainable futures.pdf
Claudio Gallicchio
 
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij
 
The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...
The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...
The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...
OECD Directorate for Financial and Enterprise Affairs
 

Recently uploaded (20)

Why Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdf
Why Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdfWhy Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdf
Why Psychological Safety Matters for Software Teams - ACE 2024 - Ben Linders.pdf
 
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
Competition and Regulation in Professions and Occupations – OECD – June 2024 ...
 
Pro-competitive Industrial Policy – OECD – June 2024 OECD discussion
Pro-competitive Industrial Policy – OECD – June 2024 OECD discussionPro-competitive Industrial Policy – OECD – June 2024 OECD discussion
Pro-competitive Industrial Policy – OECD – June 2024 OECD discussion
 
The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...
The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...
The Intersection between Competition and Data Privacy – CAPEL – June 2024 OEC...
 
Disaster Management project for holidays homework and other uses
Disaster Management project for holidays homework and other usesDisaster Management project for holidays homework and other uses
Disaster Management project for holidays homework and other uses
 
Using-Presentation-Software-to-the-Fullf.pptx
Using-Presentation-Software-to-the-Fullf.pptxUsing-Presentation-Software-to-the-Fullf.pptx
Using-Presentation-Software-to-the-Fullf.pptx
 
Carrer goals.pptx and their importance in real life
Carrer goals.pptx  and their importance in real lifeCarrer goals.pptx  and their importance in real life
Carrer goals.pptx and their importance in real life
 
XP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to LeadershipXP 2024 presentation: A New Look to Leadership
XP 2024 presentation: A New Look to Leadership
 
The remarkable life of Sir Mokshagundam Visvesvaraya.pptx
The remarkable life of Sir Mokshagundam Visvesvaraya.pptxThe remarkable life of Sir Mokshagundam Visvesvaraya.pptx
The remarkable life of Sir Mokshagundam Visvesvaraya.pptx
 
Artificial Intelligence, Data and Competition – LIM – June 2024 OECD discussion
Artificial Intelligence, Data and Competition – LIM – June 2024 OECD discussionArtificial Intelligence, Data and Competition – LIM – June 2024 OECD discussion
Artificial Intelligence, Data and Competition – LIM – June 2024 OECD discussion
 
The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...
The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...
The Intersection between Competition and Data Privacy – OECD – June 2024 OECD...
 
BRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdf
BRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdfBRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdf
BRIC_2024_2024-06-06-11:30-haunschild_archival_version.pdf
 
ASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdfASONAM2023_presection_slide_track-recommendation.pdf
ASONAM2023_presection_slide_track-recommendation.pdf
 
怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样
怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样
怎么办理(lincoln学位证书)英国林肯大学毕业证文凭学位证书原版一模一样
 
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...Competition and Regulation in Professions and Occupations – ROBSON – June 202...
Competition and Regulation in Professions and Occupations – ROBSON – June 202...
 
Pro-competitive Industrial Policy – LANE – June 2024 OECD discussion
Pro-competitive Industrial Policy – LANE – June 2024 OECD discussionPro-competitive Industrial Policy – LANE – June 2024 OECD discussion
Pro-competitive Industrial Policy – LANE – June 2024 OECD discussion
 
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
 
IEEE CIS Webinar Sustainable futures.pdf
IEEE CIS Webinar Sustainable futures.pdfIEEE CIS Webinar Sustainable futures.pdf
IEEE CIS Webinar Sustainable futures.pdf
 
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
Suzanne Lagerweij - Influence Without Power - Why Empathy is Your Best Friend...
 
The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...
The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...
The Intersection between Competition and Data Privacy – KEMP – June 2024 OECD...
 

Operators in C#

  • 2. OPERATORS • An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Operators can be categorized based upon their different functionality : • ARITHMETIC OPERATORS • RELATIONAL OPERATORS • LOGICAL OPERATORS • BITWISE OPERATORS • ASSIGNMENT OPERATORS
  • 3. OPERATORS CAN ALSO CATEGORIZED BASED UPON NUMBER OF OPERANDS : • Unary Operator • Binary Operator • Ternary Operator
  • 4. ARITHMETIC OPERATORS Operator OPERATOR NAME + ADDITION OPERATOR - SUBTRATION OPERATOR * MULTIPLICATIONOPERATOR / DIVISION OPERATOR % MODULUS OPERATOR ++ INCREEMENT OPERATOR -- DECREEMENT OPERATOR These are used to perform arithmetic operations on operands.
  • 5. RELATIONAL OPERATORS Operator OPERATOR NAME == EQUAL TO != NOT EQUAL TO > GREATER THAN < LESS THAN >= GREATER THAN EQUAL TO <= LESS THAN EQUAL TO Relational operators are used for comparison of two values.
  • 6. LOGICAL OPERATORS • They are used to combine two or more conditions/constraints or to complement the evaluation of the original condition in consideration. Operator OPERATOR NAME Example Result && Logical And (5<2)&&(5>3) False || Logical Or (5<2)||(5>3) True ! Logical not !(5<2) True
  • 7. BITWISE OPERATOR • Bitwise and bit shift operators are used to perform bit level operations on integer (int, long, etc) and boolean data. Operator Operator Name Example ~ Bitwise Complement (~A) =-61 In 11000011 & Bitwise AND (A&B)=12, In 00001100 | Bitwise OR (A|B)=61, In 00111101 ^ Bitwise Exclusive OR(XOR) (A^B)=49, In 00110001 << Bitwise left Shift A<<2=240, In 11110000
  • 8. ASSIGNMENT OPERATORS • Assignment operators are used to assigning a value to a variable. Ex: int a; a= 10;OPERATOR Operator Name Example = Value assign from right side to left operand C = A + B assigns value of A + B into C += Add and assign C += A is equivalent to C = C + A -= Subtract and assign C -= A is equivalent to C = C - A *= Multiply and assign C *= A is equivalent to C = C * A /= Devide and assign C /= A is equivalent to C = C / A %= Modulus and assign C %= A is equivalent to C = C % A
  • 9. OPERATOR Operator Name Example <<= Left shift AND assignment operator C <<= 2 is same as C = C << 2 >>= Right shift AND assignment operator C >>= 2 is same as C = C >> 2 &= Bitwise AND assignment operator C &= 2 is same as C = C & 2 ^= bitwise exclusive OR and assignment operator C ^= 2 is same as C = C ^ 2 |= bitwise inclusive OR and assignment operator C |= 2 is same as C = C | 2