FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which data type is the most suited to store a telephone number in a variable?
A
string
B
integer
C
float
D
boolean
Explanation: 

Detailed explanation-1: -A phone number is usually stored as a string (+1-999-666-3333) but can also be stored as an integer (9996663333).

Detailed explanation-2: -Phone number is a standard XDM data type that describes the details of a phone number. The internal dialing number used to call from a private exchange, operator, or switchboard.

Detailed explanation-3: -A phone number should always be stored as a string or text and never an integer. Some phone numbers generally use hyphens and possibly parentheses. Also, you might need to indicate the country code before the phone number such as +46 5555-555555.

Detailed explanation-4: -It is not unusual to see [Phone] and [DataType(DataType. PhoneNumber)] used interchangeably in C# code, and since the first usage is shorter many developers turn to it as a matter of habit.

There is 1 question to complete.