SlideShare a Scribd company logo
1 of 14
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

What's hot

ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsAmrinder Sidhu
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming Kamal Acharya
 
C OPERATOR
C OPERATORC OPERATOR
C OPERATORrricky98
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators pptViraj Shah
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inLearnbayin
 
Operators in c language
Operators in c languageOperators in c language
Operators in c languageAmit Singh
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operatorsdishti7
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++Shobi P P
 
Operators in python
Operators in pythonOperators in python
Operators in pythoneShikshak
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operatorsAnuja Lad
 

What's hot (18)

Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
ppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operatorsppt on logical/arthimatical/conditional operators
ppt on logical/arthimatical/conditional operators
 
Expression and Operartor In C Programming
Expression and Operartor In C Programming Expression and Operartor In C Programming
Expression and Operartor In C Programming
 
Java 2
Java 2Java 2
Java 2
 
C OPERATOR
C OPERATORC OPERATOR
C OPERATOR
 
C operator and expression
C operator and expressionC operator and expression
C operator and expression
 
05 operators
05   operators05   operators
05 operators
 
Types of c operators ppt
Types of c operators pptTypes of c operators ppt
Types of c operators ppt
 
Python Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.inPython Training in Bangalore | Python Operators | Learnbay.in
Python Training in Bangalore | Python Operators | Learnbay.in
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
operators in c++
operators in c++operators in c++
operators in c++
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Operators
OperatorsOperators
Operators
 
Operators in python
Operators in pythonOperators in python
Operators in python
 
Basic c operators
Basic c operatorsBasic c operators
Basic c operators
 

Viewers also liked

Geometrie 3 Thales
Geometrie 3 ThalesGeometrie 3 Thales
Geometrie 3 Thalesatire
 
HK4As AdSchool Digital Bootcamp Part 2 20130506
HK4As AdSchool Digital Bootcamp Part 2 20130506HK4As AdSchool Digital Bootcamp Part 2 20130506
HK4As AdSchool Digital Bootcamp Part 2 20130506Hungry Digital Limited
 
Done For You SEO PPC PowerPoint
Done For You SEO PPC PowerPoint	Done For You SEO PPC PowerPoint
Done For You SEO PPC PowerPoint Tahir Khawaja
 
human resources for project management
human resources for project managementhuman resources for project management
human resources for project managementAhmed Ezz-eldin
 
Dnb buyer persona-guide
Dnb buyer persona-guideDnb buyer persona-guide
Dnb buyer persona-guideRick VARGAS
 
Eui repair kits 2016
Eui repair kits 2016Eui repair kits 2016
Eui repair kits 2016Mutlu Arıcı
 
Us mobile app report
Us mobile app reportUs mobile app report
Us mobile app reportRick VARGAS
 
Team culture code: building a modern marketing team
Team culture code: building a modern marketing teamTeam culture code: building a modern marketing team
Team culture code: building a modern marketing teamFrancois Lacas
 
Digital Transformation How to Reboot IT and Business Collaboration
Digital Transformation   How to Reboot IT and Business CollaborationDigital Transformation   How to Reboot IT and Business Collaboration
Digital Transformation How to Reboot IT and Business CollaborationBizagi
 
My immortal evanescence piano sheet music
My immortal   evanescence piano sheet musicMy immortal   evanescence piano sheet music
My immortal evanescence piano sheet musicGerardo Daniel Gallo
 
Marketing Study On Castrol
Marketing Study On Castrol Marketing Study On Castrol
Marketing Study On Castrol Kavan Oza
 

Viewers also liked (20)

Geometrie 3 Thales
Geometrie 3 ThalesGeometrie 3 Thales
Geometrie 3 Thales
 
HK4As AdSchool Digital Bootcamp Part 2 20130506
HK4As AdSchool Digital Bootcamp Part 2 20130506HK4As AdSchool Digital Bootcamp Part 2 20130506
HK4As AdSchool Digital Bootcamp Part 2 20130506
 
Mm consultant profile
Mm consultant profileMm consultant profile
Mm consultant profile
 
1 parcial
1 parcial1 parcial
1 parcial
 
PRMG certificate
PRMG certificatePRMG certificate
PRMG certificate
 
Ahmed Ibrahim
Ahmed IbrahimAhmed Ibrahim
Ahmed Ibrahim
 
Done For You SEO PPC PowerPoint
Done For You SEO PPC PowerPoint	Done For You SEO PPC PowerPoint
Done For You SEO PPC PowerPoint
 
human resources for project management
human resources for project managementhuman resources for project management
human resources for project management
 
Electromagnetic Waves
Electromagnetic WavesElectromagnetic Waves
Electromagnetic Waves
 
Dnb buyer persona-guide
Dnb buyer persona-guideDnb buyer persona-guide
Dnb buyer persona-guide
 
Eui repair kits 2016
Eui repair kits 2016Eui repair kits 2016
Eui repair kits 2016
 
Data Types
Data TypesData Types
Data Types
 
Us mobile app report
Us mobile app reportUs mobile app report
Us mobile app report
 
Team culture code: building a modern marketing team
Team culture code: building a modern marketing teamTeam culture code: building a modern marketing team
Team culture code: building a modern marketing team
 
Digital Transformation How to Reboot IT and Business Collaboration
Digital Transformation   How to Reboot IT and Business CollaborationDigital Transformation   How to Reboot IT and Business Collaboration
Digital Transformation How to Reboot IT and Business Collaboration
 
My immortal evanescence piano sheet music
My immortal   evanescence piano sheet musicMy immortal   evanescence piano sheet music
My immortal evanescence piano sheet music
 
Introduction to Apache Beam
Introduction to Apache BeamIntroduction to Apache Beam
Introduction to Apache Beam
 
Website Audit Presentation
Website Audit PresentationWebsite Audit Presentation
Website Audit Presentation
 
Marketing Study On Castrol
Marketing Study On Castrol Marketing Study On Castrol
Marketing Study On Castrol
 
Galushchenko winteruni
Galushchenko winteruniGalushchenko winteruni
Galushchenko winteruni
 

Similar to Presentation on logical_operators

Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++Praveen M Jigajinni
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptxVandanaPagar1
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions NotesProf Ansari
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptxclassall
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++sanya6900
 
Operators in Python Arithmetic Operators
Operators in Python Arithmetic OperatorsOperators in Python Arithmetic Operators
Operators in Python Arithmetic Operatorsramireddyobulakondar
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statementsCtOlaf
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)jahanullah
 
C operators
C operatorsC operators
C operatorsGPERI
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01Abdul Samee
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01Abdul Samee
 
03. Operators Expressions and statements
03. Operators Expressions and statements03. Operators Expressions and statements
03. Operators Expressions and statementsIntro C# Book
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressionsmaznabili
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#Simplilearn
 

Similar to Presentation on logical_operators (20)

Java unit 3
Java unit 3Java unit 3
Java unit 3
 
Operators and Expressions in C++
Operators and Expressions in C++Operators and Expressions in C++
Operators and Expressions in C++
 
Verilog operators.pptx
Verilog  operators.pptxVerilog  operators.pptx
Verilog operators.pptx
 
Report on c
Report on cReport on c
Report on c
 
C++ Expressions Notes
C++ Expressions NotesC++ Expressions Notes
C++ Expressions Notes
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptx
 
operators and expressions in c++
 operators and expressions in c++ operators and expressions in c++
operators and expressions in c++
 
Operators in Python Arithmetic Operators
Operators in Python Arithmetic OperatorsOperators in Python Arithmetic Operators
Operators in Python Arithmetic Operators
 
Operators
OperatorsOperators
Operators
 
Operators expressions-and-statements
Operators expressions-and-statementsOperators expressions-and-statements
Operators expressions-and-statements
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
C Sharp Jn (2)
C Sharp Jn (2)C Sharp Jn (2)
C Sharp Jn (2)
 
Operators in java
Operators in javaOperators in java
Operators in java
 
C operators
C operatorsC operators
C operators
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
3 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp013 operators-expressions-and-statements-120712073351-phpapp01
3 operators-expressions-and-statements-120712073351-phpapp01
 
03. Operators Expressions and statements
03. Operators Expressions and statements03. Operators Expressions and statements
03. Operators Expressions and statements
 
03 Operators and expressions
03 Operators and expressions03 Operators and expressions
03 Operators and expressions
 
Operators and Expressions in C#
Operators and Expressions in C#Operators and Expressions in C#
Operators and Expressions in C#
 
Coper in C
Coper in CCoper in C
Coper in C
 

Recently uploaded

Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksJinanKordab
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Varun Mithran
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphNeo4j
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaNeo4j
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletAndrea Goulet
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfSrushith Repakula
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfkalichargn70th171
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanNeo4j
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxNeo4j
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAShane Coughlan
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Flutter Agency
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio, Inc.
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Lisi Hocke
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Henry Schreiner
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfICS
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNeo4j
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringPrakhyath Rai
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024MulesoftMunichMeetup
 

Recently uploaded (20)

Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
 

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…”); }