Save
...
1.2 Algorithms
1.2.6 Applying operators:
b. Relational operators:
Save
Share
Learn
Content
Leaderboard
Share
Learn
Cards (159)
The `<` operator returns true when the left operand is less than the right
operand
.
The `<=`
operator
returns true when the left operand is less than or equal to the right operand.
True
What does the `<` operator mean?
Less than
The `>` operator returns true when the left operand is less than the right operand
False
What does the `!=` operator check for?
Not equal to
The `>=` operator returns true when the left
operand
is greater than or equal to the right operand
True
The variable `are_equal` in the example code holds the value `
False
`
True
The expression `5 < 10` evaluates to `
true
`.
True
The expression `5 > 10` evaluates to `true`.
False
The expression `5 == 5` evaluates to `
true
`.
True
The relational operator `!=` returns true if both operands are not
equal
What does the `>=` relational operator check?
Greater than or equal to
The `!=` relational operator returns `true` if both operands are
not
The expression `5 == 5` evaluates to
true
Match the relational operator with its description:
`<` ↔️ Less than
`>` ↔️ Greater than
`<=` ↔️ Less than or equal to
`>=` ↔️ Greater than or equal to
The `<=` relational operator returns `true` if the left operand is less than or
equal
The `==` relational operator checks for equality between two
operands
.
True
What type of result do relational operators return?
Boolean
The `==` relational operator returns `true` if both operands are
equal
The expression `5 == 5` evaluates to `
true
`.
True
When does the `==` relational operator return `true`?
Both operands are equal
The `==` relational operator returns `true` if both operands are
equal
What does the '>=' operator return true for?
Greater than or equal to
The '!=' operator returns true if both operands are equal.
False
What does the '<=' operator return true for?
Less than or equal to
What does the '==' operator return true for?
Both operands are equal
Relational operators return a boolean result.
True
The '!=' operator returns true if both
operands
are not equal.
True
The '<' operator returns true if the left operand is greater than the right operand.
False
The '>=' operator returns true if the left operand is greater than or equal to the
right operand
.
True
What are the standard relational operators used to compare values in programming?
Less than, greater than
The `<=` operator returns true when the left operand is less than or equal to the right
operand
The expression `5 == 5` evaluates to
true
Provide an example where the `<` operator returns true.
5 < 10
The `!=` operator returns true when both
operands
are not equal.
True
The left operand must be less than the right operand for the `<` operator to
return
true.
True
The `==` operator returns true when both
operands
are equal.
True
What does the `>` operator check for in relational comparisons?
Greater than
What is the primary purpose of the `==` operator?
Check for equality
The `<` operator is used to check if the left operand is less than the right operand.
True
See all 159 cards