Friday, 23 March 2018

Logical Operators

There are only three logical operators which are related with the logical decision.These are listed in the following table-
First two operators are used to combine the conditions i.e. to form a compound conditional expression.Third operator is used to inverse the condition.
For example,
 x > y && k !=b12

This is termed as the logical expression.Whole expression also returns the Boolean value.That is, the above expression will return true when the both the conditions (x > y) and (k!=12) are true.If any one of these condition is false the expression will return false.

Consider another example,
m==99 || j <=10
This logical expression involves the logical OR operator.The expression will return true only when any one of the conditions (m==99 and j<=10) is true.If both condition are false, the whole expression will also expression will return false.

The third operator is know as logical NOT operator.This is the only unary logical operator and generally used to negate the condition.If we write this operator in front of any other relational or logical expression, the result of the expression will be inverted.That is, true will become false and false will become true.

For example,
x = 36 then
! (x > 40) will return true
! (x == 36) will return false
The following program will clear the idea of logical operators and expression.

0 Comments:

Post a Comment

Popular Posts

Categories

AI (33) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (146) C (77) C# (12) C++ (82) Course (67) Coursera (198) Cybersecurity (24) data management (11) Data Science (106) Data Strucures (8) Deep Learning (13) Django (14) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Google (21) Hadoop (3) HTML&CSS (47) IBM (25) IoT (1) IS (25) Java (93) Leet Code (4) Machine Learning (46) Meta (18) MICHIGAN (5) microsoft (4) Nvidia (1) Pandas (3) PHP (20) Projects (29) Python (893) Python Coding Challenge (285) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (42) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses