Logical Operator
They are used to combine two or more conditions using operators. There are 3 kind of operators: And(&&) , OR( || ), Not ( ! )
S.NO. | Operators | Description |
AND( &&) | Its combine two conditions using (&&) operator and iff both conditions are true then only that particular block of code start executing otherwise compiler decline that blocks executing that block |
|
Syntax:- |
||
OR ( || ) | Its combine two conditions using OR (||) operator and if anyone condition is true then only that particular block of code start executing otherwise compiler decline that blocks executing that block |
|
Syntax:-
|
||
Not ( !) | It works with one condition and converts the result as if the condition is true but after putting Not the result is False vice versa. | |
Syntax:- |
We you have any doubt let me know :)