Bird
0
0

Which Swift data type is used to store true or false values?

easy📝 Conceptual Q11 of 15
iOS Swift - Swift Language Essentials
Which Swift data type is used to store true or false values?
AInt
BDouble
CString
DBool
Step-by-Step Solution
Solution:
  1. Step 1: Understand the data types

    Bool stores true or false values, Int stores whole numbers, String stores text, and Double stores decimal numbers.
  2. Step 2: Match the description to the type

    Since the question asks for true or false values, the correct type is Bool.
  3. Final Answer:

    Bool -> Option D
  4. Quick Check:

    Bool = true/false [OK]
Quick Trick: True/false values always use Bool type [OK]
Common Mistakes:
  • Confusing Bool with Int
  • Using String for true/false
  • Choosing Double for boolean values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes