Bird
0
0

Which logical operator in Swift returns true if at least one condition is true?

easy📝 Conceptual Q1 of 15
Swift - Operators and Expressions
Which logical operator in Swift returns true if at least one condition is true?
A! (NOT)
B&& (AND)
C|| (OR)
D== (Equality)
Step-by-Step Solution
Solution:
  1. Step 1: Understand the OR operator

    The OR operator (||) returns true if any one of the conditions is true.
  2. Step 2: Compare with other operators

    AND (&&) requires both true, NOT (!) negates, and == checks equality, so they don't fit.
  3. Final Answer:

    || (OR) -> Option C
  4. Quick Check:

    Logical OR = || (OR) [OK]
Quick Trick: OR operator returns true if any condition is true [OK]
Common Mistakes:
  • Confusing AND with OR
  • Using NOT instead of OR
  • Thinking equality operator returns boolean logic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Swift Quizzes