FreeBASIC <-> C | Logical and
FreeBASIC Used keywords: and
and
Description
par1 and par2
Input
- par1 - Logical value
- par2 - Logical value
Output
- Result - Logical value
Examples
FreeBASIC
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 and false ' a1 = false
a2 = false and true ' a2 = false
a3 = true and false ' a3 = false
a4 = true and true ' a4 = true
FreeBASIC
Even one example in what situations we can use the operation logical and:a and b
a and true
10 >a and a>5
.
C Used keywords: &&
&&
Description
par1 && par2
Input
- par1 - Logical value
- par2 - Logical value
Output
- Result - Logical value
Examples
C
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 = 0 && 0; // a1 = false
a2 = 0 && 1; // a2 = false
a3 = 1 && 0; // a3 = false
a4 = 1 && 1; // a4 = true
C
Even one example in what situations we can use the operation logical and:a && b
a && 1
10 >a && a>5
FreeBASIC Used keywords: andalso
AndAlso
Description
par1 AndAlso par2
Input
- par1 - Logical value
- par2 - Logical value
Output
- Result - Logical value
Examples
FreeBASIC
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 AndAlso false ' a1 = false
a2 = false AndAlso true ' a2 = false
a3 = true AndAlso false ' a3 = false
a4 = true AndAlso true ' a4 = true
FreeBASIC
Even one example in what situations we can use the operation logical and:a and b
a and true
10 >a and a>5
.
C Used keywords: &&
&&
Description
par1 && par2
Input
- par1 - Logical value
- par2 - Logical value
Output
- Result - Logical value
Examples
C
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 = 0 && 0; // a1 = false
a2 = 0 && 1; // a2 = false
a3 = 1 && 0; // a3 = false
a4 = 1 && 1; // a4 = true
C
Even one example in what situations we can use the operation logical and:a && b
a && 1
10 >a && a>5
You can find it in the following collections: logical operators
Logical and in another programming language:
Differences to: