logical or: ||, or, OrElse

logical OR works as follows: just in case it's the result false if both inputs are false, in all other cases the result is true. In next table you can find all possibilities:
abx
FalseFalseFalse
FalseTrueTrue
TrueFalse True
TrueTrue True
information about the table: a, b are inputs, x is result

||

Description

par1 || par2
Used keywords: ||

Input


Output

if the first operand is true, then the second operand is not evaluated.
compatible programing languages:
C | Visual C++ .NET | C++ | C# | Java | JavaScript | PHP

Examples

Example

in the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 = false || false; // a1 = false
a2 = false || true;  // a2 = true
a3 = true  || false; // a3 = true
a4 = true  || true;  // a4 = true

Example

even one example in what situations we can use the operation logical or:
(b || c) || a
a || true
a>1 || a<100

Example

Other pieces of example codes:
(10 >a || a<5)
a || true
j > 128 || false

or

Description

par1 or par2
Used keywords: or

Input


Output

if the first operand is true, then the second operand is not evaluated.
compatible programing languages:
Pascal | Object Pascal | Free Pascal | PHP

Examples

Object Pascal

in the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 := false or false; // a1 = false
a2 := false or true;  // a2 = true
a3 := true  or false; // a3 = true
a4 := true  or true;  // a4 = true

Object Pascal

even one example in what situations we can use the operation logical or:
(b or c) or a
a or true
a>1 or a<100

Object Pascal

Other pieces of example codes:
j > 128 or false
a or true
(10 >a or a<5)

or

Description

par1 or par2
Used keywords: or

Input


Output

both operands are evaluated independently of the value of the first operand.
compatible programing languages:
Visual Basic .NET | FreeBASIC

Examples

Visual Basic .NET

in the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 = false or false ' a1 = false
a2 = false or true  ' a2 = true
a3 = true  or false ' a3 = true
a4 = true  or true  ' a4 = true

Visual Basic .NET

even one example in what situations we can use the operation logical or:
(b or c) or a
a or true
a>1 or a<100

Visual Basic .NET

Other pieces of example codes:
(10 >a or a<5)
a or true
j > 128 or false

OrElse

Description

par1 OrElse par2
Used keywords: orelse

Input


Output

if the first operand is true, then the second operand is not evaluated.
compatible programing languages:
Visual Basic .NET | FreeBASIC

Examples

Visual Basic .NET

in the source code you can find the equivalent of the above table, for easier orientation at the end of each line is a comment which shows the result.
a1 = false OrElse false ' a1 = false
a2 = false OrElse true  ' a2 = true
a3 = true  OrElse false ' a3 = true
a4 = true  OrElse true  ' a4 = true

Visual Basic .NET

even one example in what situations we can use the operation logical or:
(b OrElse c) OrElse a
a OrElse true
a>1 OrElse a<100

you can find it in the following collections: logical operators
Languages: en hu cz sk