Course Content
Flowgorithm Expressions
Flowgorithm Expressions
0/1
Debug Flowgorithm Flowchart
Debug Flowgorithm Flowchart
0/1
Flowgorithm Control Statements
Flowgorithm Control Statements
0/1
Flowgorithm Loops
Flowgorithm Loops
0/1
Flowgorithm For Loop
Flowgorithm For Loop
0/1
Flowgorithm While Loop
Flowgorithm While Loop
0/1
Flowgorithm Do Loop
Flowgorithm Do Loop
0/1
Flowgorithm Nested Loops
Flowgorithm Nested Loops
0/1
Export Flowgorithm Flowchart
Export Flowgorithm Flowchart
0/1
Flowgorithm Intermediate
About Lesson

Flowgorithm Logical Operators

The Flowgorithm Logical operators are as follows: 

Logical  Operator Operator  Symbol Description
Logical AND &&, AND, ∧ The Logical AND operator is a binary operator. It requires two boolean conditional expressions to be evaluated as True or False. The Logical AND returns True if both the conditions are True. Otherwise, it will return False.
Logical OR  ||, OR, ∨ The Logical OR operator is also a binary operator. It requires two boolean conditional expressions to be evaluated as True or False. The Logical OR returns False if both the conditions are False. Otherwise, it will return True.
Logical NOT !, NOT, ¬ The Logical NOT operator is a unary operator that requires only one boolean conditional expression. It negates the given condition. If the condition is False, it will return True; if it is True, it will return False.

 

Common Errors

While working with logical operators, you may encounter common errors such as:

Syntax Error

AND and OR conditional operators are binary operators. The operators require two boolean conditional expressions to evaluate the compound truth value. We get syntax errors if we omit or don’t supply two conditional expressions.

The AND operator requires two conditional expressions. In this example, the programmer supplied only one expression, which resulted in an error.

 

Flowgorithm Syntax Error

Type Mismatch Error

The conditional operators operate on Boolean data types. The conditional expressions should have Boolean results i.e. either True or False. In this example, the programmer is trying to use String datatypes along with conditional operators. This would result in a Type Mismatch error. The fix is to remove the quotes in the expressions.

For example, “age > 18”  enclosed within double quotes is a String data type in Flowgorithm, not a conditional expression.

 

Flowgorithm Type Mismatch Error

 

Logical operators are used in control structures like if-statements and loops to make decisions based on multiple criteria in Flowgorithm flowcharts.