141k views
5 votes
Which data type should you use to store a person's age?

A) String
B) Integer
C) Float
D) Boolean

User Lawton
by
7.8k points

1 Answer

3 votes

Final answer:

Use the Integer data type to store a person's age.

Step-by-step explanation:

To store a person's age, the appropriate data type to use is Integer.

An Integer data type is used to represent whole numbers without any fractional part. Since a person's age is typically represented by a whole number, such as 25 or 42, an Integer data type is the most suitable choice.

Using an Integer data type ensures that the age can be easily used in calculations or comparisons, without any unexpected results or precision issues.

User Ndrw
by
8.0k points