Courseiva
hardMultiple Choice

FC0-U71 Practice Question: A developer is writing a program that processes…

A developer is writing a program that processes whole numbers only. Which data type should be used?

⚠ Common exam trap

Many exam-takers confuse 'whole numbers' with 'numbers that might have decimals' and choose Float, not realizing that integer types are the correct and efficient choice for non-fractional data.

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

(Integer) because the program processes whole numbers only, and the integer data type is specifically designed to store non-fractional numeric values without decimal points. In most programming languages, integers are stored as 32-bit or 64-bit binary values, making them efficient for arithmetic operations on whole numbers.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Float

    Why it's wrong here

    Float stores fractional values with limited precision, so whole numbers may be represented inexactly and comparisons fail. It is tempting because floats hold numeric data, but it is intended for real numbers requiring decimal places, not integer-only arithmetic.

  • ✗

    String

    Why it's wrong here

    String stores text, so arithmetic on whole numbers requires parsing and permits non-numeric characters, losing type safety. It is tempting because digits can be typed as text, but strings are for character data such as names, not numeric computation.

  • ✗

    Boolean

    Why it's wrong here

    Boolean stores only true/false values, so it cannot hold the whole numbers the program must process. It is tempting because Booleans are a fundamental primitive type, and they would be the right choice when a variable needs to represent a binary state, such as whether a flag is enabled.

  • ✓

    Integer

    Why this is correct

    The Integer data type stores whole numbers without fractional components, matching the requirement to process whole numbers only. Floating-point types such as Float or Double would permit decimal values, so Integer is the precise choice for this constraint.

About these practice questions

Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.