nerdexam
CompTIA

FC0-U61 · Question #831

Which of the following data types would be best for storing data representing a phone number?

The correct answer is A. String. Phone numbers, although made up of digits, are best stored as strings in most programming and database contexts. This is because phone numbers may contain leading zeros, separators (such as dashes or spaces), and international codes that are not used in calculations as numeric…

Software Development

Question

Which of the following data types would be best for storing data representing a phone number?

Options

  • AString
  • BInteger
  • CFloat
  • DChar

How the community answered

(51 responses)
  • A
    90% (46)
  • B
    6% (3)
  • C
    2% (1)
  • D
    2% (1)

Explanation

Phone numbers, although made up of digits, are best stored as strings in most programming and database contexts. This is because phone numbers may contain leading zeros, separators (such as dashes or spaces), and international codes that are not used in calculations as numeric values would be. Storing phone numbers as strings preserves the exact formatting and data integrity.

Topics

#Data types#String#Programming fundamentals

Community Discussion

No community discussion yet for this question.

Full FC0-U61 Practice