mediumMultiple ChoiceObjective-mapped
FC0-U71 Practice Question: A programmer needs to store a true/false value
A programmer needs to store a true/false value. Which data type is most appropriate?
⚠ Common exam trap
Candidates may mistakenly think that integers or strings can store true/false values due to type coercion in some languages like JavaScript or Python, but the Boolean type is the correct choice for storing a true/false value.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Boolean
A Boolean data type is specifically designed to store true/false values, representing binary logic states. In most programming languages, including Python, Java, and C++, a Boolean variable can only hold one of two values: true or false, making it the most appropriate choice for this requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Integer
Why it's wrong here
Integer is for whole numbers.
- ✗
String
Why it's wrong here
String is for text.
- ✓
Boolean
Why this is correct
Boolean is specifically designed for true/false values.
- ✗
Float
Why it's wrong here
Float is for decimal numbers.
Go deeper
Related to this question
About these practice questions
This FC0-U71 question is part of Courseiva's 988-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on FC0-U71
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Which programming data type would be used to store a value of 'True' or 'False'?
medium- A.String
- B.Float
- ✓ C.Boolean
- D.Integer
Why C: Boolean data type represents true/false values.
Variation 2. Which TWO of the following are valid data types in most programming languages?
easy- ✓ A.Boolean
- B.Character
- C.Array
- ✓ D.Integer
- E.Bit
Why A: Boolean is a valid data type in most programming languages, representing true/false values. It is fundamental for conditional logic and control flow, typically stored as a single bit but often aligned to a byte for memory access efficiency.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.