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…
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)- A90% (46)
- B6% (3)
- C2% (1)
- D2% (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
Community Discussion
No community discussion yet for this question.