Using logical operators, we can combine a series of comparisons into a single expression. - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Using logical operators, we can combine a series of comparisons into a single expression.

Description:

Logical Operators tMyn Internet Application Development tMyn, Mikkeli University of Applied Sciences Logical Operators Using logical operators, ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 9
Provided by: TY64
Category:

less

Transcript and Presenter's Notes

Title: Using logical operators, we can combine a series of comparisons into a single expression.


1
Logical Operators
  • Using logical operators, we can combine a series
    of comparisons into a single expression.
  • if(lettergtA letterltZ)
  • echo This is an upper case letter.ltbrgt
  • if(incomegt100000 capitalgt1000000)
  • echo Why do you want to borrow? ltbrgt

2
  • Logical operators
  • Example Name Result
  • a and b And TRUE if both a and b are TRUE.
  • a or b Or TRUE if either a or b is TRUE.
  • a xor b Xor TRUE if either a or b is
    TRUE, but not both.
  • !a Not TRUE if a is not TRUE.
  • a b And TRUE if both a and b are TRUE.
  • a b Or TRUE if either a or b is TRUE.
  • The reason for the two different variations of
  • "and" and "or" operators is that they operate
    at different
  • precedences.

3
(No Transcript)
4
(No Transcript)
5
(No Transcript)
6
(No Transcript)
7
(No Transcript)
8
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com