SlideShare a Scribd company logo
Logical Operators
ICT Level V
COT - Jaffna
1
S.Sakthybaalan
8/30/20162
Operator
 An operator is a symbol that tells the compiler to perform specific
mathematical or logical manipulations.
 C# is rich in built-in operators and provides the following kinds of
operators:
 Arithmetic Operators
 Relational Operators
 Logical Operators
 Bitwise Operators
 Assignment Operators
 Misc Operators
8/30/20163
Operators
Arithmetic Operators
Relational Operators
Bitwise Operators
Assignment Operators
Misc Operators
Logical Operators
8/30/20164
Logical Operators (Conditional
Operators)
 Logical operators allows you to combine multiple conditions.
 These operators involves at least two conditions and the final
Boolean result is determined by the operator being used.
AND
OR
XOR
NOT
Logical Operators
8/30/20165
Operand and Operators
 In all computer languages, expressions consist of two types of
components: operands and operators.
 Operands are the objects that are manipulated.
 Operators are the symbols that represent specific actions.
 example:
5 + x
 Note:
 All expressions have at least one operand.
operator
operands
8/30/20166
AND Operator (&&)
 The AND operator is used to compare two Boolean values.
 It returns true if both of the operands are true.
a b Result (AND)
0 0 0
0 1 0
1 0 0
1 1 1
0 – false
1 - true
8/30/20167
AND Operator in Programming
name = "Steven";
password = "Steven123";
// evaluating both expression and returns true if all are true.
if (name == "Steven" && password == "Steven123")
{
MessageBox.Show("Login Successful");
}
else
{
MessageBox.Show "Unauthorised access");
}
8/30/20168
OR Operator (||)
 The OR operator is similar to AND, as it is used to compare two
Boolean values.
 The OR operator returns true if either of the operand(s) are true.
a b Result (OR)
0 0 0
0 1 1
1 0 1
1 1 1
}
0 – false
1 - true
8/30/20169
OR Operator in Programming
string username, password;
if ((username == "Steven" || username == “Clark")
&& (password == "Steven123"))
{
MessageBox.Show("Login Successful");
}
else
{
MessageBox.Show("Unauthorised access");
}
8/30/201610
NOT Operator (!)
 The NOT operator is a unary operator, as it operates on a single
operand.
 The NOT operator inverts the value of a Boolean value.
 If the original value is true then the returned value is false; if the
original value is false, the return value is true.
a Result (NOT)
0 1
1 0
0 – false
1 - true
8/30/201611
NOT Operator in Programming
name = "Steven";
password = "Steven123";
// evaluating both expression and returns true if all are true.
if ( !(name == "Steven" && password == "Steven123"))
{
MessageBox.Show("Login Successful");
}
else
{
MessageBox.Show("Unauthorised access. Aborting…");
}
8/30/201612
XOR Operator (^)
 It returns false if the following condition matches:
 (i) if both or all the expression returns true.
 (ii) If both or all the expression returns false.
a b Result (XOR)
0 0 0
0 1 1
1 0 1
1 1 0
0 – false
1 - true
8/30/201613
XOR Operator in Programming
string name, password;
name = "Steven" ;
password = "Steven123" ;
//it returns false because both expression match.
if ((name == "Steven" ^ password == “Clark")
{
MessageBox.Show(“Access granted…");
}
else
{
MessageBox.Show (“Access Denied. Aborting…”);
}
8/30/201614

More Related Content

PPTX
Operators in Java
PPTX
Logical and Conditional Operator In C language
PDF
Operators in java
PDF
Conditional operators
 
PPTX
OCA JAVA - 3 Programming with Java Operators
PPTX
Operators in java
PDF
itft-Operators in java
PPTX
Operators in java presentation
Operators in Java
Logical and Conditional Operator In C language
Operators in java
Conditional operators
 
OCA JAVA - 3 Programming with Java Operators
Operators in java
itft-Operators in java
Operators in java presentation

What's hot (18)

PDF
Java basic operators
PPTX
ppt on logical/arthimatical/conditional operators
PPTX
Expression and Operartor In C Programming
PPT
PPTX
C OPERATOR
PPT
C operator and expression
PPTX
05 operators
PPT
Types of c operators ppt
PPTX
Python Training in Bangalore | Python Operators | Learnbay.in
PPT
Operators in c language
PPTX
Basic c operators
PPT
6 operators-in-c
ODP
operators in c++
PPTX
Operators in C/C++
PDF
Operators in python
PPTX
PDF
Operators in python
PPT
Basic c operators
Java basic operators
ppt on logical/arthimatical/conditional operators
Expression and Operartor In C Programming
C OPERATOR
C operator and expression
05 operators
Types of c operators ppt
Python Training in Bangalore | Python Operators | Learnbay.in
Operators in c language
Basic c operators
6 operators-in-c
operators in c++
Operators in C/C++
Operators in python
Operators in python
Basic c operators
Ad

Viewers also liked (20)

ODP
Geometrie 3 Thales
PDF
HK4As AdSchool Digital Bootcamp Part 2 20130506
TXT
Mm consultant profile
PDF
1 parcial
PDF
PRMG certificate
PPTX
Ahmed Ibrahim
PPTX
Done For You SEO PPC PowerPoint
DOCX
human resources for project management
PPT
Electromagnetic Waves
PDF
Dnb buyer persona-guide
PDF
Eui repair kits 2016
PPTX
PDF
Us mobile app report
PDF
Team culture code: building a modern marketing team
PPTX
Digital Transformation How to Reboot IT and Business Collaboration
PDF
My immortal evanescence piano sheet music
PDF
Introduction to Apache Beam
PPTX
Marketing Study On Castrol
PDF
Galushchenko winteruni
Geometrie 3 Thales
HK4As AdSchool Digital Bootcamp Part 2 20130506
Mm consultant profile
1 parcial
PRMG certificate
Ahmed Ibrahim
Done For You SEO PPC PowerPoint
human resources for project management
Electromagnetic Waves
Dnb buyer persona-guide
Eui repair kits 2016
Us mobile app report
Team culture code: building a modern marketing team
Digital Transformation How to Reboot IT and Business Collaboration
My immortal evanescence piano sheet music
Introduction to Apache Beam
Marketing Study On Castrol
Galushchenko winteruni
Ad

Similar to Presentation on logical_operators (20)

PPTX
Operators used in vb.net
PPTX
11operator in c#
PPTX
operat in vb .pptx
PPTX
C Operators
PDF
c# operators
PPTX
Operators in C & C++ Language
PDF
4. operators in c programming by digital wave
ODP
Operators
PPTX
Session03 operators
PPTX
Python notes for students to develop and learn
PPTX
OPERATORS OF C++
PPTX
Operators in c++
PPTX
Data Types and Operators in Python2.pptx
PPTX
operator (1).pptx
PPTX
Logical Operators C/C++ language Programming
PPT
CBSE Class XI :- Operators in C++
PPTX
Java script session 4
PPTX
Python tutorials for beginners | IQ Online Training
PPTX
Operator in c programming
PPTX
Lecture 6
Operators used in vb.net
11operator in c#
operat in vb .pptx
C Operators
c# operators
Operators in C & C++ Language
4. operators in c programming by digital wave
Operators
Session03 operators
Python notes for students to develop and learn
OPERATORS OF C++
Operators in c++
Data Types and Operators in Python2.pptx
operator (1).pptx
Logical Operators C/C++ language Programming
CBSE Class XI :- Operators in C++
Java script session 4
Python tutorials for beginners | IQ Online Training
Operator in c programming
Lecture 6

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
top salesforce developer skills in 2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Essential Infomation Tech presentation.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Nekopoi APK 2025 free lastest update
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
System and Network Administraation Chapter 3
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How to Choose the Right IT Partner for Your Business in Malaysia
top salesforce developer skills in 2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Essential Infomation Tech presentation.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Odoo POS Development Services by CandidRoot Solutions
Nekopoi APK 2025 free lastest update
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms II-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
System and Network Administraation Chapter 3
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Operating system designcfffgfgggggggvggggggggg
Internet Downloader Manager (IDM) Crack 6.42 Build 41
VVF-Customer-Presentation2025-Ver1.9.pptx
Wondershare Filmora 15 Crack With Activation Key [2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Presentation on logical_operators

  • 1. Logical Operators ICT Level V COT - Jaffna 1 S.Sakthybaalan
  • 2. 8/30/20162 Operator  An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.  C# is rich in built-in operators and provides the following kinds of operators:  Arithmetic Operators  Relational Operators  Logical Operators  Bitwise Operators  Assignment Operators  Misc Operators
  • 3. 8/30/20163 Operators Arithmetic Operators Relational Operators Bitwise Operators Assignment Operators Misc Operators Logical Operators
  • 4. 8/30/20164 Logical Operators (Conditional Operators)  Logical operators allows you to combine multiple conditions.  These operators involves at least two conditions and the final Boolean result is determined by the operator being used. AND OR XOR NOT Logical Operators
  • 5. 8/30/20165 Operand and Operators  In all computer languages, expressions consist of two types of components: operands and operators.  Operands are the objects that are manipulated.  Operators are the symbols that represent specific actions.  example: 5 + x  Note:  All expressions have at least one operand. operator operands
  • 6. 8/30/20166 AND Operator (&&)  The AND operator is used to compare two Boolean values.  It returns true if both of the operands are true. a b Result (AND) 0 0 0 0 1 0 1 0 0 1 1 1 0 – false 1 - true
  • 7. 8/30/20167 AND Operator in Programming name = "Steven"; password = "Steven123"; // evaluating both expression and returns true if all are true. if (name == "Steven" && password == "Steven123") { MessageBox.Show("Login Successful"); } else { MessageBox.Show "Unauthorised access"); }
  • 8. 8/30/20168 OR Operator (||)  The OR operator is similar to AND, as it is used to compare two Boolean values.  The OR operator returns true if either of the operand(s) are true. a b Result (OR) 0 0 0 0 1 1 1 0 1 1 1 1 } 0 – false 1 - true
  • 9. 8/30/20169 OR Operator in Programming string username, password; if ((username == "Steven" || username == “Clark") && (password == "Steven123")) { MessageBox.Show("Login Successful"); } else { MessageBox.Show("Unauthorised access"); }
  • 10. 8/30/201610 NOT Operator (!)  The NOT operator is a unary operator, as it operates on a single operand.  The NOT operator inverts the value of a Boolean value.  If the original value is true then the returned value is false; if the original value is false, the return value is true. a Result (NOT) 0 1 1 0 0 – false 1 - true
  • 11. 8/30/201611 NOT Operator in Programming name = "Steven"; password = "Steven123"; // evaluating both expression and returns true if all are true. if ( !(name == "Steven" && password == "Steven123")) { MessageBox.Show("Login Successful"); } else { MessageBox.Show("Unauthorised access. Aborting…"); }
  • 12. 8/30/201612 XOR Operator (^)  It returns false if the following condition matches:  (i) if both or all the expression returns true.  (ii) If both or all the expression returns false. a b Result (XOR) 0 0 0 0 1 1 1 0 1 1 1 0 0 – false 1 - true
  • 13. 8/30/201613 XOR Operator in Programming string name, password; name = "Steven" ; password = "Steven123" ; //it returns false because both expression match. if ((name == "Steven" ^ password == “Clark") { MessageBox.Show(“Access granted…"); } else { MessageBox.Show (“Access Denied. Aborting…”); }