Complete the code to check if both conditions are true using the AND operator.
val a = true
val b = false
val result = a [1] b
println(result)The AND operator && returns true only if both sides are true.
Complete the code to check if at least one condition is true using the OR operator.
val x = false
val y = true
val result = x [1] y
println(result)The OR operator || returns true if at least one side is true.
Fix the error in the code by using the correct NOT operator.
val flag = true
val result = [1]flag
println(result)The NOT operator ! negates the boolean value.
Fill both blanks to create a condition that is true only if a is true and b is false.
val a = true val b = false val result = a [1] [2]b println(result)
Use && to require both conditions, and ! to negate b.
Fill all three blanks to create a condition that is true if either a is false, or both b and c are true.
val a = true val b = true val c = false val result = [1]a [2] (b [3] c) println(result)
Use ! to negate a, || for OR, and && for AND inside parentheses.
