FC0-U71 Integer data type Practice Question
A developer is writing code and uses a variable to store a user's age. Which TWO data types are appropriate for storing a whole number age?
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
✓
Integer
A whole number age can be stored as an integer data type (C) which is specifically designed for integers, or as a float data type (E) which can represent whole numbers without decimal points as floating-point numbers. Both are appropriate, though integer is more efficient. The other types (Boolean, Character, String) are not suitable for numeric storage.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Boolean
Why it's wrong here
Boolean is for true/false values, not numbers.
- ✗
Character
Why it's wrong here
Character is for single characters like 'a', not numbers.
- ✓
Integer
Why this is correct
Integer is the standard data type for storing whole numbers without decimals.
- ✗
String
Why it's wrong here
String is for text, not numeric values.
- ✓
Float
Why this is correct
Float can represent whole numbers, making it an appropriate data type for storing age, although integer is more typical for this use case.
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
1 more way 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. A programmer declares a variable 'price' and assigns it the value 19.99. In most programming languages, what is the data type of this variable?
hard- A.Boolean
- ✓ B.Float
- C.String
- D.Integer
Why B: 19.99 is a number with a decimal point, so it is a floating-point number (float). Integer is a whole number, string is text, and boolean is true/false.
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.